检查当前的transparent_hugepage状态(以下为开启状态)
https://www.cndba.cn/zhasir/article/3438
https://www.cndba.cn/zhasir/article/3438
https://www.cndba.cn/zhasir/article/3438https://www.cndba.cn/zhasir/article/3438https://www.cndba.cn/zhasir/article/3438
[root@localhost ~]# cat /sys/kernel/mm/transparent_hugepage/enabled
[always] madvise never
[root@localhost ~]# cat /sys/kernel/mm/transparent_hugepage/defrag
[always] madvise never
关闭方法有两种,一种为临时关闭,一种为永久关闭:
1)临时关闭
https://www.cndba.cn/zhasir/article/3438
https://www.cndba.cn/zhasir/article/3438
[root@localhost ~]# echo never > /sys/kernel/mm/transparent_hugepage/enabled
[root@localhost ~]# echo never > /sys/kernel/mm/transparent_hugepage/defrag
https://www.cndba.cn/zhasir/article/3438https://www.cndba.cn/zhasir/article/3438
[root@localhost ~]# vim /etc/rc.d/rc.local
if test -f /sys/kernel/mm/transparent_hugepage/enabled; then
echo never > /sys/kernel/mm/transparent_hugepage/enabled
fi
if test -f /sys/kernel/mm/transparent_hugepage/defrag; then
echo never > /sys/kernel/mm/transparent_hugepage/defrag
fi
授予执行权限
[root@localhost ~]# chmod +x /etc/rc.d/rc.local
版权声明:本文为博主原创文章,未经博主允许不得转载。