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

2016-08-06 23:16:56 +08:00
 billlee

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

于是修改配置,在 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 我确认连接数远没有打满,也看不出其它问题。那是不是我的配置有什么问题呢?

6954 次点击
所在节点    HAProxy
1 条回复
fcicq
2016-08-07 08:35:44 +08:00
不是 tcp 握手时间吗?

这是一个专为移动设备优化的页面(即为了让你能够在 Google 搜索结果里秒开这个页面),如果你希望参与 V2EX 社区的讨论,你可以继续到 V2EX 上打开本讨论主题的完整版本。

https://www.v2ex.com/t/297630

V2EX 是创意工作者们的社区,是一个分享自己正在做的有趣事物、交流想法,可以遇见新朋友甚至新机会的地方。

V2EX is a community of developers, designers and creative people.

© 2021 V2EX