Linux – How to configure swappiness in Linux Memory Management

linuxperformanceswap

The swappiness parameter controls the tendency of the kernel to move processes out of physical memory and onto the swap disk. What is the default setting and how to configure that to improve overall performance?

Best Answer

The Linux kernel provides a tweakable setting that controls swappiness

$ cat /proc/sys/vm/swappiness
60  

open /etc/sysctl.conf as root. Then, change or add this line to the file:

vm.swappiness = 10

for changing the swappiness value temporarily try this command:

$ echo 50 > /proc/sys/vm/swappiness