mongodb中的transparent_hugepage / defrag警告

时间:2015-04-14 11:16:36

标签: mongodb centos

进入mongo shell时我收到警告

** WARNING: /sys/kernel/mm/transparent_hugepage/defrag is 'always'.
**        We suggest setting it to 'never'

即使我已将以下选项附加到grub.conf中的内核命令行:

transparent_hugepage=never

检查

$ cat /sys/kernel/mm/redhat_transparent_hugepage/enabled
always [never]
$ cat /sys/kernel/mm/redhat_transparent_hugepage/defrag
[always] never

是的,我在更改GRUB选项并重新启动mongod服务后重启机器。

GRUB版

$ grub-install -v
grub-install (GNU GRUB 0.97)

CentOS版

$ cat /etc/redhat-release
CentOS release 6.4 (Final)

1 个答案:

答案 0 :(得分:0)

以root身份运行以下命令:

if test -f /sys/kernel/mm/transparent_hugepage/defrag;
then   echo never > /sys/kernel/mm/transparent_hugepage/defrag;
fi

然后检查它是否有效:

cat /sys/kernel/mm/transparent_hugepage/enabled

应该给出这个输出:

always madvise [never]