Configuring swappiness

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:

root@VM:~$ 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.

To change the system swappiness value

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,

sysctl -p

CrownCloud - Get a SSD powered KVM VPS at $4.5/month!
Use the code WELCOME for 10% off!

1 GB RAM / 25 GB SSD / 1 CPU Core / 1 TB Bandwidth per month

Available Locations: LAX | MIA | ATL | FRA | AMS