After installing Ubuntu the swappiness is standard set to 60. This is sufficient for servers but for home-users it is much too high. Best to do is changing the swappiness to a lower level, i.e.: 10.
How to do it:
- Open a terminal
- type in or copy/paste: sudo gedit /etc/sysctl.conf
- a file will be opened
- add the following line at the bottom of that file:
vm.swappiness = 10
- save the file and close it.
After rebooting the swappiness is set to 10. This can be checked by running the following command in a terminal: sudo cat /proc/sys/vm/swappiness.
The swap tendency can have a value of 0 (fully off) to 100 (swap is constantly used).
A workable and practical rule for changing the swappiness can be:
1 GB or more RAM: 10
Less than 1 GB of RAM: 1
Your computer has less than 512 MB of RAM? Try to change the swap tendency to 0 (zero). With lower amount of memory installed, this might even give a better result then changing the swap tendency to 1.