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
Ubuntu uses a default setting of swappiness=60
cat /proc/sys/vm/swappiness
A temporary change (lost at reboot) can be made with:
sudo sysctl vm.swappiness=10
To make the changes permanent, edit this file:
sudo gedit /etc/sysctl.conf
And edit the value
vm.swappiness=10
(if this value doesn't exist, create it at the end of the file)
Changes will apply at next reboot.
1 comment:
Actually, you can use sysctl -p to load it from /etc/sysctl.conf without rebooting!
Post a Comment