From e068d584f12da6ee926851c6a4704cfa3896acce Mon Sep 17 00:00:00 2001 From: Tony Sansone Date: Wed, 14 Feb 2018 16:13:09 -0600 Subject: [PATCH 1/3] (DOCSP-1271, DOCS-10405): Updated Production Notes. --- source/administration/production-notes.txt | 73 +++++++++++++++++++--- 1 file changed, 63 insertions(+), 10 deletions(-) diff --git a/source/administration/production-notes.txt b/source/administration/production-notes.txt index c0ecfda7bcf..9b78f11ff5c 100644 --- a/source/administration/production-notes.txt +++ b/source/administration/production-notes.txt @@ -559,6 +559,43 @@ possible, use XFS as it generally performs better with MongoDB. *on directories*. For example, HGFS and Virtual Box's shared folders do *not* support this operation. +Set ``vm.swappiness`` at least ``1`` +```````````````````````````````````` + +“Swappiness” is a Linux kernel setting that influences the behavior of +the Virtual Memory manager when it needs to allocate a swap, ranging +from ``0`` to ``100``, inclusive. + +- A setting of ``0`` tells the kernel to swap only to avoid + out-of-memory problems. + +- A setting of ``100`` tells it to swap aggressively to disk. + +If your host runs kernel versions ``3.5`` or later, or ``2.6.32-303`` +or later, setting this value to ``0`` could disable swapping. Set this +to ``1``. + +To see what the current swappiness level is, run: + +.. code-block:: sh + + example@example:$ cat /proc/sys/vm/swappiness + + 60 + +To change swappiness while the system is running, run: + +.. code-block:: sh + + example@example:$ sysctl vm.swappiness=1 + +To change swappiness permanently, edit the ``/etc/sysctl.conf`` file in +your preferred text editor and change this value: + +.. code-block:: ini + + vm.swappiness = 1 + .. _linux-recommended-configuration: Recommended Configuration @@ -740,20 +777,36 @@ accommodate Windows' commitment rules during peak database use. MongoDB on Virtual Environments ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -This section describes considerations when running MongoDB in some of the -more common virtual environments. +This section describes considerations when running MongoDB in some of +the more common virtual environments. For all platforms, consider :ref:`virtualized-disks-scheduling`. -EC2 -``` +:abbr:`AWS (Amazon Web Services)` :abbr:`EC2 (Elastic Compute Cloud)` +````````````````````````````````````````````````````````````````````` + +- When available, enable :abbr:`AWS (Amazon Web Services)` + `Enhanced Networking `_ + for your instance. Not all instance types support Enhanced Networking. + + To learn more about Enhanced Networking, see to the + `AWS documentation `_. + +- Use provisioned IOPS for the storage, with separate devices for + journal and data. Do not use the ephemeral storage available on some + instance types as their performance changes moment to moment. + +- Disable hyperthreading, + :abbr:`DVFS (dynamic voltage and frequency scaling)`, + :abbr:`CPU (central processing unit)` power saving modes. + + .. seealso:: + + - `Amazon blog post on disabling Hyper-Threading `_. + + - `Amazon documentation on Processor State Control `_ -When available, enable AWS's `Enhanced Networking -`_ -for your instance. Not all instance types support Enhanced Networking. -Refer to the `AWS documentation -`_ -for more information. +- Use ``numactl`` to bind memory locality to a single socket. .. _windows-azure-production-notes: From bfe8d1f3977a7d447bd5e7fe57636966be15221c Mon Sep 17 00:00:00 2001 From: Anthony Sansone Date: Wed, 21 Feb 2018 00:17:27 -0600 Subject: [PATCH 2/3] Updated per @dalyd and @steveren reviews. --- source/administration/production-notes.txt | 38 +++++++++++++++------- 1 file changed, 27 insertions(+), 11 deletions(-) diff --git a/source/administration/production-notes.txt b/source/administration/production-notes.txt index 9b78f11ff5c..504ff0d2063 100644 --- a/source/administration/production-notes.txt +++ b/source/administration/production-notes.txt @@ -559,8 +559,8 @@ possible, use XFS as it generally performs better with MongoDB. *on directories*. For example, HGFS and Virtual Box's shared folders do *not* support this operation. -Set ``vm.swappiness`` at least ``1`` -```````````````````````````````````` +Set ``vm.swappiness`` to ``1`` +`````````````````````````````` “Swappiness” is a Linux kernel setting that influences the behavior of the Virtual Memory manager when it needs to allocate a swap, ranging @@ -571,7 +571,8 @@ from ``0`` to ``100``, inclusive. - A setting of ``100`` tells it to swap aggressively to disk. -If your host runs kernel versions ``3.5`` or later, or ``2.6.32-303`` +If your host runs kernel versions ``3.5`` or later, or +:abbr:`RHEL (Red Hat Enterprise Linux)` / CentOS kernel ``2.6.32-303`` or later, setting this value to ``0`` could disable swapping. Set this to ``1``. @@ -785,27 +786,42 @@ For all platforms, consider :ref:`virtualized-disks-scheduling`. :abbr:`AWS (Amazon Web Services)` :abbr:`EC2 (Elastic Compute Cloud)` ````````````````````````````````````````````````````````````````````` -- When available, enable :abbr:`AWS (Amazon Web Services)` +There are two performance configurations to consider: + +- Reproducible performance for performance testing or benchmarking, and +- Raw maximum performance + +To tune performance on :abbr:`EC2 (Elastic Compute Cloud)` for either +configuration, you should: + +- Enable :abbr:`AWS (Amazon Web Services)` `Enhanced Networking `_ for your instance. Not all instance types support Enhanced Networking. To learn more about Enhanced Networking, see to the `AWS documentation `_. -- Use provisioned IOPS for the storage, with separate devices for - journal and data. Do not use the ephemeral storage available on some - instance types as their performance changes moment to moment. +- Use provisioned :abbr:`IOPS (Input/Output Operations Per Second)` for + the storage, with separate devices for journal and data. Do not use + the ephemeral storage available on some instance types as their + performance changes moment to moment. -- Disable hyperthreading, - :abbr:`DVFS (dynamic voltage and frequency scaling)`, +- Disable :abbr:`DVFS (dynamic voltage and frequency scaling)` and :abbr:`CPU (central processing unit)` power saving modes. .. seealso:: - - `Amazon blog post on disabling Hyper-Threading `_. - - `Amazon documentation on Processor State Control `_ +If you are concerned more about reproducible performance on +:abbr:`EC2 (Elastic Compute Cloud)`, you should also: + +- Disable hyperthreading. + + .. seealso:: + + - `Amazon blog post on disabling Hyper-Threading `_. + - Use ``numactl`` to bind memory locality to a single socket. .. _windows-azure-production-notes: From 58d1cb8a1a3feb31b5406d6ff40d5666090d57a0 Mon Sep 17 00:00:00 2001 From: Tony Sansone Date: Mon, 5 Mar 2018 11:12:43 -0500 Subject: [PATCH 3/3] Updated per @dalyd review. --- source/administration/production-notes.txt | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/source/administration/production-notes.txt b/source/administration/production-notes.txt index 504ff0d2063..0c59b42d9cb 100644 --- a/source/administration/production-notes.txt +++ b/source/administration/production-notes.txt @@ -801,26 +801,27 @@ configuration, you should: To learn more about Enhanced Networking, see to the `AWS documentation `_. -- Use provisioned :abbr:`IOPS (Input/Output Operations Per Second)` for - the storage, with separate devices for journal and data. Do not use - the ephemeral storage available on some instance types as their - performance changes moment to moment. +If you are concerned more about reproducible performance on +:abbr:`EC2 (Elastic Compute Cloud)`, you should also: + +- Use provisioned :abbr:`IOPS (Input/Output Operations Per Second)` + for the storage, with separate devices for journal and data. Do not + use the ephemeral (:abbr:`SSD (Solid State Disk)`) storage available + on most instance types as their performance changes moment to moment. + (The ``i`` series is a notable exception, but very expensive.) - Disable :abbr:`DVFS (dynamic voltage and frequency scaling)` and :abbr:`CPU (central processing unit)` power saving modes. .. seealso:: - - `Amazon documentation on Processor State Control `_ - -If you are concerned more about reproducible performance on -:abbr:`EC2 (Elastic Compute Cloud)`, you should also: + `Amazon documentation on Processor State Control `_ - Disable hyperthreading. .. seealso:: - - `Amazon blog post on disabling Hyper-Threading `_. + `Amazon blog post on disabling Hyper-Threading `_. - Use ``numactl`` to bind memory locality to a single socket.