一、禁止交換(每臺機器都要作):vim
執行命令:vim /etc/sysctl.conf
bash
增長一行:vm.swappiness=0app
執行命令:sudo sysctl vm.swappiness=0
spa
二、禁用大頁面(每臺機器都要作):code
執行命令:class
echo never > /sys/kernel/mm/transparent_hugepage/defrag
echo never > /sys/kernel/mm/transparent_hugepage/enabled配置
執行命令,修改配置:vim /etc/rc.local權限
增長兩行:im
echo never > /sys/kernel/mm/transparent_hugepage/defragvi
echo never > /sys/kernel/mm/transparent_hugepage/enabled
執行命令,賦予權限:chmod +x /etc/rc.d/rc.local