Vm.swappiness disables swap partition performance improvement

  

wappiness

centos default vm.swappiness value is 60, this default value is already very suitable. But you can change the loading of the swap to a smaller size and the system performance will improve.


cat /proc/sys/vm/swappiness


You will see the value is 60, change:

sysctl Vm.swappiness=10


This will change the value from 60 to 10, which can greatly reduce the system's write to swap. It is recommended that friends with 512m or more memory use this. method.

If you find that you have very little use of swap, you can set the value to 0. This does not prevent you from using swap, but instead makes your system write as little as possible to swap, and use as much of your actual memory as possible.

This is great for switching applications, because they are in physical memory rather than swap partitions.

If you want to change this value permanently, you need to change the sysctl.conf file:


Add:

vm.swappiness=10< Br>

To the last line, the restart needs to take effect.


In large memory servers we need to set this value to 0, especially on the Mysql server.

Copyright © Windows knowledge All Rights Reserved