警告1 : WARNING: The TCP backlog setting of 511 cannot be enforced because /proc/sys/net/core/somaxconn is set to the lower value of 128
解释:上面写的很清晰,意思是配置 /proc/sys/net/core/somaxconn的值是128,虽然redis.conf中配置的是511,但是linux内核会以无提示的方式将其截断为128。在一个高并发的环境下,128是远远不够的,所以我们要改大一些
办法:将net.core.somaxconn = 2048
添加到/etc/sysctl.conf
中,然后执行sysctl -p
生效配置
警告2: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、1、2
0, 表示内核将检查是否有足够的可用内存供应用进