The Linux kernel provides a tweak-able setting that controls how often the swap file is used, called swappiness.
A swappiness setting of zero means that the disk will be avoided unless absolutely necessary (you run out of memory)
You can check your own system's swappiness value by running:
[email protected]:~$ cat /proc/sys/vm/swappiness 60
We suggest to turn down swappiness down to 10 or 15. The swap file will then only be used when the RAM usage is around 80 or 90 percent.
Edit /etc/sysctl.conf as root, nano /etc/sysctl.conf Then, change or add this line to the file,
vm.swappiness = 10
Then issue the following command, to load the vm.swappiness value set above,