redis性能调优调整以下参数,可以⼤幅度改善Redis集的稳定性:
记录⼀次redis集⼀次排查过程:
总结来说,有以下⼏个问题:
1.由于cluster-node-timeout设置⽐较短,慢查询KEYS导致了集判断节点8371失联
2.由于8371失联,导致8373升级为主,开始主从同步
3.由于配置client-output-buffer-limit的限制,导致第⼀次全量同步失败了
4.⼜由于PHP客户端的连接池有问题,疯狂连接服务器,产⽣了类似SYN攻击的效果
5.第⼀次全量同步失败后,从节点重连主节点花了30秒(超过了最⼤连接数1w)
关于client-output-buffer-limit参数:
# The syntax of every client-output-buffer-limit directive is the following:
#
# client-output-buffer-limit <class> <hard limit> <soft limit> <soft seconds>
#
# A client is immediately disconnected once the hard limit is reached, or if
# the soft limit is reached and remains reached for the specified number of
# seconds (continuously).
# So for instance if the hard limit is 32 megabytes and the soft limit is
# 16 megabytes / 10 seconds, the client will get disconnected immediately
# if the size of the output buffers reach 32 megabytes, but will also get
# disconnected if the client reaches 16 megabytes and continuously overcomes
# the limit for 10 seconds.
#
# By default normal clients are not limited because they don't receive data
# without asking (in a push way), but just after a request, so only
# asynchronous clients may create a scenario where data is requested faster
# than it can read.
#
# Instead there is a default limit for pubsub and slave clients, since
# subscribers and slaves receive data in a push fashion.
#
# Both the hard or the soft limit can be disabled by setting them to zero.
client-output-buffer-limit normal 0 0 0timeout was reached
client-output-buffer-limit slave 256mb 64mb 60
client-output-buffer-limit pubsub 32mb 8mb 60
采取措施:
1.单实例的切割到4G以下,否则发⽣主从切换会耗时很长
2.调整client-output-buffer-limit参数,防⽌同步进⾏到⼀半失败
3.调整cluster-node-timeout,不能少于15s
4.禁⽌任何耗时超过cluster-node-timeout的慢查询,因为会导致主从切换
Redis配置参数详解

版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系QQ:729038198,我们将在24小时内删除。