diff --git a/modules/install/pages/install-swap-space.adoc b/modules/install/pages/install-swap-space.adoc index be5b382c44..63060fa4e5 100644 --- a/modules/install/pages/install-swap-space.adoc +++ b/modules/install/pages/install-swap-space.adoc @@ -4,7 +4,7 @@ [abstract] {description} -For optimal Couchbase Server performance on most Linux systems, you should set swappiness to 0. +Swappiness should be set to 1 or 0 on most Linux systems to achieve optimal Couchbase Server performance. Couchbase Server efficiently uses available RAM for your working set data; ideally, sufficient RAM remains available to the operating system above and beyond your cluster’s configured server RAM quota. It's always a good idea to configure a reasonable amount of virtual memory or swap space on Linux-based nodes. (There are no recommended virtual memory optimizations for Windows-based nodes.) @@ -16,9 +16,23 @@ The swappiness range is from 0 to 100, and most Linux distributions have swappin Couchbase Server is optimized with its managed cache to use RAM, and is capable of managing what should be in RAM and what shouldn't be. Allowing the OS to have too much control over what memory pages are in RAM is likely to lower Couchbase Server’s performance. -Therefore, it is recommended that you set swappiness to zero. +Therefore, it's recommended that swappiness be set to the levels listed below. +.Recommended Swappiness Settings for Linux +[#recommended-swappiness-settings,cols="1,1",options="header"] +|=== +|Linux Kernel Version |Recommended Swappiness +|3.5-rc1 and higher +|1* + +|Older versions +|0 +|=== + +*Linux kernel 3.5-rc1 and higher introduced a change in behavior for `swappiness=0`. +Depending on how a Linux OS implements this change, it has the potential to increase the risk of OOM killing under strong memory and I/O pressure. +As a result, the recommended swappiness setting for these Linux platforms is 1. (Though, it may be the case that a given Linux OS has implemented or patched this change in such a way that a swappiness setting of 0 is still preferred.) == Changing Swappiness Setting @@ -33,7 +47,7 @@ This behavior is undesirable given Couchbase Server's memory-first architecture. cat /proc/sys/vm/swappiness ---- + -Proceed to the next step if the output isn't zero. +If the output doesn't match the <>, proceed to the next step. . Change the swappiness setting. + @@ -60,12 +74,12 @@ sudo sh -c 'echo "" >> /etc/sysctl.conf' + [source,console] ---- -sudo sh -c 'echo "#Set swappiness to 0 to minimize swapping" >> /etc/sysctl.conf' +sudo sh -c 'echo "#Set swappiness to 1 to minimize swapping" >> /etc/sysctl.conf' ---- + [source,console] ---- -sudo sh -c 'echo "vm.swappiness = 0" >> /etc/sysctl.conf' +sudo sh -c 'echo "vm.swappiness = 1" >> /etc/sysctl.conf' ---- Setting swappiness needs to be a part of the build process for any new Couchbase node.