Skip to content

DOCS-1351 - updated keepalive info #2190

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 1 commit into from
Closed
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
54 changes: 35 additions & 19 deletions source/faq/diagnostics.txt
Original file line number Diff line number Diff line change
Expand Up @@ -29,31 +29,47 @@ following commands:

.. _faq-keepalive:

Does TCP ``keepalive`` time affect sharded clusters and replica sets?
---------------------------------------------------------------------

If you experience socket errors between members of a sharded cluster
or replica set, that do not have other reasonable causes, check the
TCP keep alive value, which Linux systems store as the
``tcp_keepalive_time`` value. A common keep alive period is ``7200``
seconds (2 hours); however, different distributions and OS X may have
different settings. For MongoDB, you will have better experiences with
shorter keepalive periods, on the order of ``120`` seconds (two minutes).
Does TCP ``keepalive`` time affect MongoDB Deployments?
-------------------------------------------------------

If you experience socket errors between clients and servers or between
members of a sharded cluster or replica set that do not have other
reasonable causes, check the TCP keepalive value, which Linux systems
store as the ``tcp_keepalive_time`` value. A common keepalive period
is ``7200`` seconds (2 hours); however, different distributions and OS
X may have different settings. For MongoDB, you will have better
experiences with shorter keepalive periods, on the order of ``120``
seconds (two minutes).

If your MongoDB deployment experiences keepalive-related issues, you
must alter the ``tcp_keepalive_time`` value on all machines hosting
MongoDB processes. This includes all machines hosting
:program:`mongos` or :program:`mongod` servers and all machines
hosting client processes that connect to MongoDB.

.. versionchanged:: 2.0

Beginning in release series 2.0, :program:`mongod` and :program:`mongos`
processes independently set keepalive times to a minumum of 5 minutes on
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 setting the TCP keepalive value persistently.

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

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

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

What tools are available for monitoring MongoDB?
------------------------------------------------
Expand Down