To check the swappiness value
cat /proc/sys/vm/swappiness
To change the swappiness value A temporary change (lost on reboot) with a swappiness value of 10 can be made with
sudo sysctl vm.swappiness=10
To make a change permanent, edit the configuration file with your favorite editor:
vi /etc/sysctl.conf
Search for vm.swappiness and change its value as desired. If vm.swappiness does not exist, add it to the end of the file like so:
vm.swappiness=10
Save the file and reboot.
本文介绍如何在Linux系统中检查和调整swappiness值。通过修改此值可以控制系统倾向于使用更多RAM还是更频繁地将数据交换到磁盘。文中提供了临时调整及永久更改swappiness的方法。
2964

被折叠的 条评论
为什么被折叠?



