Please use more RAM then swap…

As we can read on http://kerneltrap.org: “Swappiness is a kernel “knob” (located in /proc/sys/vm/swappiness) used to tweak how much the kernel favors swap over RAM; high swappiness means the kernel will swap out a lot, and low swappiness means the kernel will try not to use swap space.”
Less swap usage = less I/O operations = higher performance. Of course it has some limits. In order to set it we need to edit /etc/sysctl.conf and add value:
vm.swappiness=30
vm.swappiness can be set from 0..100 where less value means use less swap but more RAM. By default the most of distros set 60. You can check current value by:
lenovo init.d # sysctl vm.swappiness
vm.swappiness = 30

More accurate articles we can find here:
http://www.linuxvox.com/2009/10/what-is-the-linux-kernel-parameter-vm-swappiness/
http://lwn.net/Articles/100978/

Advertisements