In Linux, you can improve the performance of your system by modifying the Swappiness kernel parameters to reduce the system's use of swap.
The problem is this, after the release of the new version of the product, hourly memory usage will have a spike. Although this peak is far from reaching the server's physical memory, it is true that the system starts using swap when memory usage peaks. In the swap process, the performance of the system decreases, showing a large service delay. In this case, you can reduce the system's use of swap by adjusting the swappiness kernel parameters to avoid the performance impact of unnecessary swap.
In short, this parameter defines the system's propensity to use swap, with the default value of 60, and the larger the value, the more likely it is to use swap. can be set to 0, this does not prohibit the use of swap, but minimizes the possibility of using swap.
The current settings of the parameters can be viewed by sysctl-q vm.swappiness.
The way to modify the parameters is to modify the/etc/sysctl.conf file, add the vm.swappiness=xxx, and restart the system. This action is equivalent to modifying the/proc/sys/vm/swappiness file in the virtual system and changing the value to XXX values.
If you do not want to restart, you can dynamically load the/etc/sysctl.conf file via Sysctl-p, but it is recommended that you clear swap before doing so.
Adjust swap usage with swappiness kernel parameters