Linux swappiness set parameters to configure how much memory to use to begin the swap partition (rpm) at

 

Swappiness size of the value of the swap partition is on how to have a great contact. swappiness = 0 indicates when the maximum physical memory and swap space is, swappiness = 100 indicates when an active use of swap area, and the timely data transfer memory to the swap space on the inside. Linux basic default set to 60, as follows:

cat /proc/sys/vm/swappiness
#60

In other words, use your memory to 100-60 = 40% of the time, they have started using the swap partition appears. As you know, the memory speed is much faster than disk, like this will increase the system IO, change into a large number of pages at the same time made into swapped out, seriously affect system performance, so we are at the operating system level, to use the memory as much as possible , the parameters to be adjusted.

Temporary adjustment method is as follows, we tune into 10:

sysctl vm.swappiness=10
#vm.swappiness=10
cat /proc/sys/vm/swappiness
#10

This is just a temporary adjustment method, after the restart will return to the default settings.

To permanently adjusted to it, we need to modify /etc/sysctl.conf, adding:

sudo vim /etc/sysctl.conf

Plus

The maximum Number of Controls # Shared Memory Segments, in Pages 
kernel.shmall = 4294967296 # which can not set a 
vm.swappiness = 10

 Become effective

sudo sysctl -p

This completes modify the settings!

 

Swappiness size of the value of the swap partition is on how to have a great contact. swappiness = 0 indicates when the maximum physical memory and swap space is, swappiness = 100 indicates when an active use of swap area, and the timely data transfer memory to the swap space on the inside. Linux basic default set to 60, as follows:

cat /proc/sys/vm/swappiness
#60

In other words, use your memory to 100-60 = 40% of the time, they have started using the swap partition appears. As you know, the memory speed is much faster than disk, like this will increase the system IO, change into a large number of pages at the same time made into swapped out, seriously affect system performance, so we are at the operating system level, to use the memory as much as possible , the parameters to be adjusted.

Temporary adjustment method is as follows, we tune into 10:

sysctl vm.swappiness=10
#vm.swappiness=10
cat /proc/sys/vm/swappiness
#10

This is just a temporary adjustment method, after the restart will return to the default settings.

To permanently adjusted to it, we need to modify /etc/sysctl.conf, adding:

sudo vim /etc/sysctl.conf

Plus

The maximum Number of Controls # Shared Memory Segments, in Pages 
kernel.shmall = 4294967296 # which can not set a 
vm.swappiness = 10

 Become effective

sudo sysctl -p

This completes modify the settings!

 

Guess you like

Origin www.cnblogs.com/liuys635/p/11407651.html