警告日志
WARNING you have Transparent Huge Pages (THP) support enabled in your kernel. This will create latency and memory usage issues with Redis. To fix this issue run the command 'echo never > /sys/kernel/mm/transparent_hugepage/enabled' as root, and add it to your /etc/rc.local in order to retain the setting after a reboot. Redis must be restarted after THP is disabled.
翻译:警告您的内核中启用了透明大页面(THP)支持。这将导致Redis的延迟和内存使用问题。要解决此问题,请以root用户身份运行命令“echo never>/sys/kernel/mm/transparent_hugepage/enabled”,并将其添加到/etc/rc.local中,以便在重新启动后保留设置。禁用THP后,必须重新启动Redis。
解决方法
查看服务状态
[root@mrwang logs]# cat /sys/kernel/mm/transparent_hugepage/enabled
[always] madvise never
[root@mrwang logs]# echo never>/sys/kernel/mm/transparent_hugepage/enabled
[root@mrwang logs]# cat /sys/kernel/mm/transparent_hugepage/enabled
always madvise [never]
编辑rc.local文件,增加代码。
vi /etc/rc.local
添加代码如下:
if test -f /sys/kernel/mm/redhat_transparent_hugepage/enabled; then
echo never > /sys/kernel/mm/redhat_transparent_hugepage/enabled
fi
或者
echo never > /sys/kernel/mm/redhat_transparent_hugepage/enabled
来源:https://blog.yoodb.com/yoodb/article/detail/1720