我收到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]
我加入的伎俩transparent_hugepage=never
,以GRUB_CMDLINE_LINUX_DEFAULT
中/etc/default/grub
和添加
if test -f /sys/kernel/mm/transparent_hugepage/defrag; then
echo never > /sys/kernel/mm/transparent_hugepage/defrag
fi
至 /etc/rc.local
我到底该如何避免警告?
sudo service mongod restart
了,警告才消失了!谢谢!这很奇怪,为什么我不能重启虚拟机?