今天启动redis报错,看了下报错的信息:
WARNING overcommit_memory is set to 0! Background save may fail under low memory condition. To fix this issue add 'vm.overcommit_memory = 1' to /etc/sys
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 i
WARNING: The TCP backlog setting of 511 cannot be enforced because /proc/sys/net/core/somaxconn is set to the lower value of 128.
1.如图:

错误原因:由于我是安装的redis3.0,可能是版本比较旧,这句话的翻译大概就是:对一个高负载的环境来说tcp设置128这个值,太小了。 这是我的理解,具体的还需到官网理解 手动设置,或者设置永久值.所以执行:
2.执行命令: vi etc/sysctl.conf

3.在文件里面添加 net.core.somaxconn= 1024

4.保存退出 然后执行sysctl -p 然后可以正常启动

本文解决Redis启动时遇到的警告问题,包括overcommit_memory设置、Transparent Huge Pages支持和TCP backlog设置过小的问题。通过修改配置文件,将net.core.somaxconn设置为1024,解决了因TCP backlog设置不足导致的潜在性能问题。
2584

被折叠的 条评论
为什么被折叠?



