billlee
V2EX  ›  HAProxy

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

  •  
  •   billlee · Aug 6, 2016 · 7962 views
    This topic created in 3563 days ago, the information mentioned may be changed or developed.

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

    于是修改配置,在 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 replies    2016-08-07 08:35:44 +08:00
    fcicq
        1
    fcicq  
       Aug 7, 2016
    不是 tcp 握手时间吗?
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   3228 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 33ms · UTC 14:19 · PVG 22:19 · LAX 07:19 · JFK 10:19
    ♥ Do have faith in what you're doing.