美文网首页
Redis启动三个警告 必须注意!

Redis启动三个警告 必须注意!

作者: 我爱张智容 | 来源:发表于2020-12-02 15:18 被阅读0次
    32293:M 02 Dec 15:03:19.394 # WARNING: The TCP backlog setting of 511 cannot be enforced because /proc/sys/net/core/somaxconn is set to the lower value of 128.
    
    32293:M 02 Dec 15:03:19.394 # 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/sysctl.conf and then reboot or run the command 'sysctl vm.overcommit_memory=1' for this to take effect.
    
    32293:M 02 Dec 15:03:19.394 # 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.
    
    

    这是必须解决的 :

    解决方案都是持久性配置,不是临时配置。
    
    第一个警告
    vim /etc/sysctl.conf
    net.core.somaxconn = 1024 # 增加此行 保存退出 
    sysctl -p # 执行此行生效
    
    第二个警告
    vim /etc/sysctl.conf
    vm.overcommit_memory = 1 # 增加此行 保存退出 
    sysctl -p # 执行此行生效
    
    第三个警告 (!!!请根据日志文件提示调整!!!)
    将其写入/etc/rc.local文件中:
    vim /etc/rc.local 
    if test -f /sys/kernel/mm/transparent_hugepage/enabled; then
       echo never > /sys/kernel/mm/transparent_hugepage/enabled
    fi
    
    source /etc/rc.local   //让配置生效
    

    相关文章

      网友评论

          本文标题:Redis启动三个警告 必须注意!

          本文链接:https://www.haomeiwen.com/subject/mnxuwktx.html