linux启动redis时报错

2.WARNING: The TCP backlog setting of 511 cannot be enforced because
/proc/sys/net/core/somaxconn is set to the lower value of 128

意思大概是 tcp 连接数设置为 128 太小了

解决方案:

①修改配置文件 vim /etc/sysctl.conf

(1)写入:net.core.somaxconn=551 # 这里的数据根据生产的需要和电脑的性能进行调整 必须 大于等于 551

注意:修改配置文件时要按insert切换最下侧显示insert后录入;保存时按esc然后按冒号“:”,输入wq保存退出

(2)保存之后执行 sysctl -p 使得修改生效,可以再次利用命令vim /etc/sysctl.conf进入配置文件查看是否修改成功

3.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

意思大概是 overcommit_memory 的值设置为0时 在低内存条件下,后台保存可能会失败

解决方案:

①修改配置文件 vim /etc/sysctl.conf

(1)写入:vm.overcommit_memory=1

注意:修改配置文件时要按insert切换最下侧显示insert后录入;保存时按esc然后按冒号“:”,输入wq保存退出

(2)保存之后执行 sysctl -p 使得修改生效,可以再次利用命令vim /etc/sysctl.conf进入配置文件查看是否修改成功

4.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.

意思大概是Redis建议修改Transparent Huge Pages(THP) 的相关配置,Linux kernel在2.6.38内核增加了THP特性, 支持大内存页(2MB) 分配, 默认开启。 当开启时可以降低fork子进程的速度, 但fork操作之后, 每个内存页从原来4KB变为2MB, 会大幅增加重写期间父进程内存消耗。 同时每次写命令引起的复制内存页单位放大了512倍, 会拖慢写操作的执行时间, 导致
大量写操作慢查询。

解决方案:

①Redis日志中建议将此特性进行禁用, 禁用方法如下:

echo never > /sys/kernel/mm/transparent_hugepage/enabled
————————————————
原文链接:https://blog.csdn.net/weixin_46188145/article/details/127259837

  • 5
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值