Skip to content

Commit 59d98e3

Browse files
author
Michael Paik
committed
DOCS-1351 - updated keepalive info
1 parent 4995d89 commit 59d98e3

File tree

1 file changed

+35
-19
lines changed

1 file changed

+35
-19
lines changed

source/faq/diagnostics.txt

Lines changed: 35 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -29,31 +29,47 @@ following commands:
2929

3030
.. _faq-keepalive:
3131

32-
Does TCP ``keepalive`` time affect sharded clusters and replica sets?
33-
---------------------------------------------------------------------
34-
35-
If you experience socket errors between members of a sharded cluster
36-
or replica set, that do not have other reasonable causes, check the
37-
TCP keep alive value, which Linux systems store as the
38-
``tcp_keepalive_time`` value. A common keep alive period is ``7200``
39-
seconds (2 hours); however, different distributions and OS X may have
40-
different settings. For MongoDB, you will have better experiences with
41-
shorter keepalive periods, on the order of ``120`` seconds (two minutes).
32+
Does TCP ``keepalive`` time affect MongoDB Deployments?
33+
-------------------------------------------------------
34+
35+
If you experience socket errors between clients and servers or between
36+
members of a sharded cluster or replica set that do not have other
37+
reasonable causes, check the TCP keepalive value, which Linux systems
38+
store as the ``tcp_keepalive_time`` value. A common keepalive period
39+
is ``7200`` seconds (2 hours); however, different distributions and OS
40+
X may have different settings. For MongoDB, you will have better
41+
experiences with shorter keepalive periods, on the order of ``120``
42+
seconds (two minutes).
43+
44+
If your MongoDB deployment experiences keepalive-related issues, you
45+
must alter the ``tcp_keepalive_time`` value on all machines hosting
46+
MongoDB processes. This includes all machines hosting
47+
:program:`mongos` or :program:`mongod` servers and all machines
48+
hosting client processes that connect to MongoDB.
49+
50+
.. versionchanged:: 2.0
51+
52+
Beginning in release series 2.0, :program:`mongod` and :program:`mongos`
53+
processes independently set keepalive times to a minumum of 5 minutes on
54+
their own sockets.
4255

4356
.. include:: /includes/fact-tcp-keepalive-linux.rst
4457
.. include:: /includes/fact-tcp-keepalive-osx.rst
58+
59+
The above methods of setting the TCP keepalive are not persistent; you
60+
will need to reset the new ``tcp_keepalive_time`` value each time you
61+
reboot or restart a system. see your operating system's documentation
62+
for setting the TCP keepalive value persistently.
63+
4564
.. include:: /includes/fact-tcp-keepalive-windows.rst
4665

47-
The new ``tcp_keepalive_time`` value takes effect without requiring
48-
you to restart the :program:`mongod` or :program:`mongos`
49-
servers. When you reboot or restart your system you will need to set
50-
the new ``tcp_keepalive_time`` value, or see your operating system's
51-
documentation for setting the TCP keepalive value persistently.
66+
.. versionchanged:: 2.0
5267

53-
If your replica set or sharded cluster experiences keepalive-related
54-
issues, you must alter the ``tcp_keepalive_time`` value on all machines
55-
hosting MongoDB processes. This includes all machines hosting
56-
:program:`mongos` or :program:`mongod` servers.
68+
You will need to restart :program:`mongod` and :program:`mongos`
69+
servers for new system-wide ``tcp_keepalive_time`` settings to take
70+
effect on server versions newer than 2.0 if the new value is less than
71+
600 seconds. Values greater than or equal to 600 seconds will be
72+
ignored by :program:`mongod` and :program:`mongos`.
5773

5874
What tools are available for monitoring MongoDB?
5975
------------------------------------------------

0 commit comments

Comments
 (0)