zoukankan      html  css  js  c++  java
  • redis性能调优

    https://www.cnblogs.com/aquester/p/9891477.html

    大压力下Redis参数调整要点

    调整以下参数,可以大幅度改善Redis集群的稳定性:

    记录一次redis集群一次排查过程:

    https://blog.csdn.net/daiyudong2020/article/details/52496725

    总结来说,有以下几个问题:
    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 0
    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的慢查询,因为会导致主从切换

    5.修复客户端类似SYN攻击的疯狂连接方式
    ————————————————
    版权声明:本文为CSDN博主「带鱼兄」的原创文章,遵循CC 4.0 BY-SA版权协议,转载请附上原文出处链接及本声明。
    原文链接:https://blog.csdn.net/daiyudong2020/article/details/52496725

    Redis配置参数详解

    https://blog.csdn.net/ljl890705/article/details/51540427

  • 相关阅读:
    Linux读写执行权限对目录和文件的影响
    配置DNS服务安全加密传输遇到的问题
    如何将vim编辑器中的内容,按照列提取信息后,重新输入到文件中?
    虚拟机配置仅主机模式,无法ping通网关
    配置计划任务
    内存检测的脚本文件
    mount挂载的小问题:mount: no medium found on /dev/sr0
    名词解释
    电流、电压、功率的计算方式
    name 、 request_name 、 session_name 优先级
  • 原文地址:https://www.cnblogs.com/guanghuiqq/p/14777074.html
Copyright © 2011-2022 走看看