我收到了 Mongodb 关于 THP 的警告
2015-03-06T21:01:15.526-0800 I CONTROL [initandlisten] ** WARNING: /sys/kernel/mm/transparent_hugepage/defrag is 'always'.
2015-03-06T21:01:15.526-0800 I CONTROL [initandlisten] ** We suggest setting it to 'never'
但我成功手动关闭了 THP
frederick@UbuntuVirtual:~$ cat /sys/kernel/mm/transparent_hugepage/enabled
always madvise [never]
frederick@UbuntuVirtual:~$ cat /sys/kernel/mm/transparent_hugepage/defrag
always madvise [never]
我通过在 /etc/default/grub
中将 transparent_hugepage=never
添加到 GRUB_CMDLINE_LINUX_DEFAULT
并添加
if test -f /sys/kernel/mm/transparent_hugepage/defrag; then
echo never > /sys/kernel/mm/transparent_hugepage/defrag
fi
到 /etc/rc.local
我到底怎样才能避免这种警告呢?