On Linux, swap space is used when the physical memory (RAM) is full.
If the system needs more memory resources and the RAM is full, inactive pages in memory are moved to the swap space. Swappiness indicates how frequently a system uses the swap space based on RAM usage. The swappiness range is from 0 to 100 where, by default, most Linux platforms have swappiness set to 60.
For the optimal Couchbase Server operations, set the swappiness to 0 (zero).
To change the swap configuration:
- Execute cat /proc/sys/vm/swappiness on each node to determine the current swap usage configuration.
- Execute sudo sysctl vm.swappiness=0 to immediately change the swap configuration and ensure that it persists through server restarts.
- Using sudo or root user privileges, edit the kernel parameters configuration file, /etc/sysctl.conf , so that the change is always in effect.
- Append vm.swappiness = 0 to the file.
- Reboot your system.