Swapping is designed for Low memory systems. Now a days plenty of RAM space available. RAM is much faster than HDD. Swap uses Hard disk space as virtual RAM. If you reduce the usage of HDD and increase the usage of RAM will boot the performance of your system.
The parameter named swappiness controls the tendency of the kernel to move processes out of physical memory and onto the swap disk.
- swappiness can have a value of between 0 and 100
- swappiness=0 tells the kernel to avoid swapping processes out of physical memory for as long as possible
- swappiness=100 tells the kernel to aggressively swap processes out of physical memory and move them to swap cache
Reducing the default value of swappiness will probably improve overall performance for a typical Ubuntu desktop installation.
For Desktop users A value of swappiness=10 is recommended.
For Server , it is better to use swappiness=60
How to Check swappiness value
Open a terminal and type the following command
$ cat /proc/sys/vm/swappiness
$ sudo sysctl vm.swappiness=10
How to permanently change the swappiness value
$ gksudo gedit /etc/sysctl.conf
change the value of
vm.swappiness = 10
No rebooting required