V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
billlee
V2EX  ›  HAProxy

经过 HAProxy 后发现引入了很大的延迟?

  •  
  •   billlee · 2016-08-06 23:16:56 +08:00 · 6912 次点击
    这是一个创建于 2791 天前的主题,其中的信息可能已经有所发展或是发生改变。

    前情提要:发现以前的配置无法保持长连接

    于是修改配置,在 defaults 中加入了

        timeout tunnel 300s
        timeout client-fin 5s
    

    现在连接相关的参数是:

    defaults
        mode                    tcp
        log                     global
        option                  tcplog
        option                  dontlognull
        option                  redispatch
        retries                 3
        timeout queue           1m
        timeout connect         5s
        timeout client          5s
        timeout server          5s
        timeout tunnel          300s
        timeout client-fin      5s
        timeout check           5s
        maxconn                 3000
    

    修改后,发现连接延迟变差了,均值和方差都增大了,有时候延迟能超过 1 s.

    当然改之前也是平均延迟要大于 100 ms, 但是客户端到 haproxy 的延迟和 haproxy 到服务端的延迟加起来只有不到 40ms 的。

    通过 stats 我确认连接数远没有打满,也看不出其它问题。那是不是我的配置有什么问题呢?

    1 条回复    2016-08-07 08:35:44 +08:00
    fcicq
        1
    fcicq  
       2016-08-07 08:35:44 +08:00
    不是 tcp 握手时间吗?
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   我们的愿景   ·   实用小工具   ·   981 人在线   最高记录 6543   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 26ms · UTC 21:59 · PVG 05:59 · LAX 14:59 · JFK 17:59
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.