1、禁止交换(每台机器都要做):
执行命令:vim /etc/sysctl.conf
增加一行:vm.swappiness=0
执行命令:sudo sysctl vm.swappiness=0
2、禁用大页面(每台机器都要做):
执行命令:
echo never > /sys/kernel/mm/transparent_hugepage/defrag
echo never > /sys/kernel/mm/transparent_hugepage/enabled
执行命令,修改配置:vim /etc/rc.local
增加两行:
echo never > /sys/kernel/mm/transparent_hugepage/defrag
echo never > /sys/kernel/mm/transparent_hugepage/enabled
执行命令,赋予权限:chmod +x /etc/rc.d/rc.local