diff --git a/source/administration/production-notes.txt b/source/administration/production-notes.txt index c0ecfda7bcf..0c59b42d9cb 100644 --- a/source/administration/production-notes.txt +++ b/source/administration/production-notes.txt @@ -559,6 +559,44 @@ 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`` 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 +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 +: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``. + +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 +778,52 @@ 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)` +````````````````````````````````````````````````````````````````````` + +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 `_. + +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 `_ + +- Disable hyperthreading. + + .. seealso:: + + `Amazon blog post on disabling Hyper-Threading `_. -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: