mariusv.com

Watch as I awkwardly stumble through life

MySQL must not swap

Posted by Marius Voila on January 30, 2014 in London, U.K . — 0 comments This post contains 86 words

MySQL must not swap. This can be managed via /proc/sys/vm/swappiness, this value determines how aggressive is the system in term of swapping. Default is 60, for MySQL server 0 is recommended. Setting 0 does not mean that you never swap, the system will only swap to prevent out of memory.

$ sudo sysctl -w vm.swappiness=0
$ sudo echo "vm.swappiness=0" >> /etc/sysctl.conf
$ sudo swapoff -a && sudo swapon -a