linux – control server swapiness

Get current value:
cat /proc/sys/vm/swappiness

Use sysctl change value for temporaly:
sysctl vm.swappiness=10 or save value there /etc/sysctl.conf

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

Disable swapping:

echo 0 > /proc/sys/vm/swappiness

Leave a Reply

Your email address will not be published. Required fields are marked *