Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 0 additions & 6 deletions source/faq/diagnostics.txt
Original file line number Diff line number Diff line change
Expand Up @@ -55,12 +55,6 @@ their own sockets.

.. include:: /includes/fact-tcp-keepalive-linux.rst
.. include:: /includes/fact-tcp-keepalive-osx.rst

The above methods of setting the TCP keepalive are not persistent; you
will need to reset the new ``tcp_keepalive_time`` value each time you
reboot or restart a system. see your operating system's documentation
for instructions on setting the TCP keepalive value persistently.

.. include:: /includes/fact-tcp-keepalive-windows.rst

.. versionchanged:: 2.0
Expand Down
21 changes: 20 additions & 1 deletion source/includes/fact-tcp-keepalive-linux.rst
Original file line number Diff line number Diff line change
@@ -1,6 +1,12 @@
On Linux systems you can use the following operation to check the
value of ``tcp_keepalive_time``:

.. code-block:: sh

sysctl net.ipv4.tcp_keepalive_time

Or the following:

.. code-block:: sh

cat /proc/sys/net/ipv4/tcp_keepalive_time
Expand All @@ -10,5 +16,18 @@ The value is measured in seconds. You can change the

.. code-block:: sh

echo <value> > /proc/sys/net/ipv4/tcp_keepalive_time
sudo sysctl -w net.ipv4.tcp_keepalive_time=<value>

Or the following:

.. code-block:: sh

echo <value> | sudo tee /proc/sys/net/ipv4/tcp_keepalive_time

This does not persist across system reboots. To do so, add the
following line to ``/etc/sysctl.conf``:

.. code-block:: sh

net.ipv4.tcp_keepalive_time = <value>

5 changes: 5 additions & 0 deletions source/includes/fact-tcp-keepalive-osx.rst
Original file line number Diff line number Diff line change
Expand Up @@ -11,3 +11,8 @@ To set a shorter keep alive period use the following invocation:

sysctl -w net.inet.tcp.keepinit=<value>

The change is not persistent; you will need to reset the new
``tcp_keepalive_time`` value each time you reboot or restart a
system. See your operating system's documentation for instructions
on setting it persistently.