# 假设需要修改为10 [root@localhost ~]# echo 'vm.swappiness = 10' >> /etc/sysctl.conf [root@localhost ~]# sysctl -p # 查看配置是否生效 [root@localhost ~]# sysctl vm.swappiness