16.17.6. Using "swappiness" parameter ( Linux only )
For Linux users only
, there is a kernel tuning parameter called "swappiness
"
that controls how much the kernel favors swap over RAM.
When hosting large data sets, it is recommended that this parameter be changed from its default value of 60 to something closer to 10, to reduce the amount of swapping that takes place on the server. Useful tidbits regarding swappiness include:
-
The swappiness setting is found in the file
/proc/sys/vm/swappiness
. -
The command
/sbin/sysctl vm.swappiness
can be used to view its setting. -
The command
/sbin/sysctl -w vm.swappiness=10
can be used to change its value. -
Adding
vm.swappiness = 10
to the file/etc/sysctl.conf
will force the value to be set at machine boot time.