diff --git a/source/administration/production-notes.txt b/source/administration/production-notes.txt index 53caf38315f..7b00a822386 100644 --- a/source/administration/production-notes.txt +++ b/source/administration/production-notes.txt @@ -459,6 +459,38 @@ MongoDB's performance and ease of use. For more information, see `this blog post `_. +Azure +````` +For all MongoDB deployments using Azure, you **must** mount volume +that hosts the :program:`mongod` instance's :setting:`~storage.dbPath` +with the *Host Cache Preference* ``READ/WRITE``. + +This applies to all Azure deployments, using any guest operating +system. + +If your volumes have inappropriate cache settings, MongoDB may +eventually shut down with the following error: + +.. code-block:: none + + [DataFileSync] FlushViewOfFile for failed with error 1 ... + [DataFileSync] Fatal Assertion 16387 + +These shut downs do not produce data loss if when +:setting:`storage.journal.enabled` is set to ``true``. You can safely +restart :program:`mongod` at any time following this event. + +The performance characteristics of MongoDB may change with +``READ/WRITE`` caching enabled. + +The TCP keepalive on the Azure load balancer is 240 seconds by +default, which can cause it to silently drop connections if the TCP +keepalive on your Azure systems is greater than this value. You +should set ``tcp_keepalive_time`` to 120 to ameliorate this problem. + +.. include:: /includes/fact-tcp-keepalive-linux.rst +.. include:: /includes/fact-tcp-keepalive-windows.rst + VMWare `````` diff --git a/source/faq/diagnostics.txt b/source/faq/diagnostics.txt index ad87343aa85..6f9d90f8924 100644 --- a/source/faq/diagnostics.txt +++ b/source/faq/diagnostics.txt @@ -38,21 +38,9 @@ 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 ``300`` seconds (five minutes). +shorter keepalive periods, on the order of ``120`` seconds (two minutes). -On Linux systems you can use the following operation to check the -value of ``tcp_keepalive_time``: - -.. code-block:: sh - - cat /proc/sys/net/ipv4/tcp_keepalive_time - -You can change the ``tcp_keepalive_time`` value with the following -operation: - -.. code-block:: sh - - echo 300 > /proc/sys/net/ipv4/tcp_keepalive_time +.. include:: /includes/fact-tcp-keepalive.rst The new ``tcp_keepalive_time`` value takes effect without requiring you to restart the :program:`mongod` or :program:`mongos` @@ -60,30 +48,11 @@ 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. -For OS X systems, issue the following command to view the keep alive -setting: - -.. code-block:: sh - - sysctl net.inet.tcp.keepinit - -To set a shorter keep alive period use the following invocation: - -.. code-block:: sh - - sysctl -w net.inet.tcp.keepinit=300 - 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. -Windows users should consider the `Windows Server Technet Article on -KeepAliveTime configuration -`_ -for more information on setting keep alive for MongoDB deployments on -Windows systems. - What tools are available for monitoring MongoDB? ------------------------------------------------ diff --git a/source/includes/fact-tcp-keepalive-linux.rst b/source/includes/fact-tcp-keepalive-linux.rst new file mode 100644 index 00000000000..bd478e0b8c4 --- /dev/null +++ b/source/includes/fact-tcp-keepalive-linux.rst @@ -0,0 +1,14 @@ +On Linux systems you can use the following operation to check the +value of ``tcp_keepalive_time``: + +.. code-block:: sh + + cat /proc/sys/net/ipv4/tcp_keepalive_time + +The value is measured in seconds. You can change the +``tcp_keepalive_time`` value with the following operation: + +.. code-block:: sh + + echo > /proc/sys/net/ipv4/tcp_keepalive_time + diff --git a/source/includes/fact-tcp-keepalive-osx.rst b/source/includes/fact-tcp-keepalive-osx.rst new file mode 100644 index 00000000000..1c67b93729d --- /dev/null +++ b/source/includes/fact-tcp-keepalive-osx.rst @@ -0,0 +1,13 @@ +For OS X systems, issue the following command to view the keep alive +setting: + +.. code-block:: sh + + sysctl net.inet.tcp.keepinit + +To set a shorter keep alive period use the following invocation: + +.. code-block:: sh + + sysctl -w net.inet.tcp.keepinit= + diff --git a/source/includes/fact-tcp-keepalive-windows.rst b/source/includes/fact-tcp-keepalive-windows.rst new file mode 100644 index 00000000000..4722f592077 --- /dev/null +++ b/source/includes/fact-tcp-keepalive-windows.rst @@ -0,0 +1,22 @@ +For Windows systems, issue the following command to view the keep alive +setting: + +.. code-block:: powershell + + reg query HKLM\SYSTEM\CurrentControlSet\Services\Tcpip\Parameters /v KeepAliveTime + +The registry value is not present by default. The system default used +if the value is absent, is 7200000 *milliseconds*, or ``0x6ddd00`` in +hexadecimal. To set a shorter keep alive period use the following +invocation in an Administrator :guilabel:`Command Prompt`, where +```` is expressed in hexadecimal (e.g. ``0x0124c0`` is 120000): + +.. code-block:: powershell + + reg add HKLM\SYSTEM\CurrentControlSet\Services\Tcpip\Parameters\ /v KeepAliveTime /d + +Windows users should consider the `Windows Server Technet Article on +KeepAliveTime +`_ +for more information on setting keep alive for MongoDB deployments on +Windows systems. diff --git a/source/includes/fact-tcp-keepalive.rst b/source/includes/fact-tcp-keepalive.rst new file mode 100644 index 00000000000..3eb9e11ce74 --- /dev/null +++ b/source/includes/fact-tcp-keepalive.rst @@ -0,0 +1,3 @@ +.. include:: /includes/fact-tcp-keepalive-linux.rst +.. include:: /includes/fact-tcp-keepalive-osx.rst +.. include:: /includes/fact-tcp-keepalive-windows.rst