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。
解决办法:
先关闭redis,关于如何关闭redis并重启redis请参考我本篇文章:
https://blog.csdn.net/changyana/article/details/123289897
然后输入如下命令
sudo vim /etc/rc.local
然后按键盘上的a
键进入编辑模式,之后在最后输入如下代码
echo never > /sys/kernel/mm/transparent_hugepage/enabled
然后按esc
键,输入:wq
表示退出并保存。
之后重启redis就不会有WARNING了!