我试图更多地了解 Haproxy 时间。以下是 Haproxy 手册中的时间片段:
Tq:获取客户端请求的总时间(仅限 HTTP 模式)...
Tw:在等待连接槽的队列中花费的总时间......
Tc:与服务器建立 TCP 连接的总时间....
Tr:服务器响应时间(仅限 HTTP 模式)...
Tt:总会话持续时间,在代理接受它的那一刻和两端都关闭的那一刻之间......
来源: http : //cbonte.github.io/haproxy-dconv/configuration-1.5.html#8.4
我试图绘制一些时序图,但我的图可能不正确并且绝对不完整(没有 FIN 等):
问题:完整的时序图会是什么样子,包括所有时序测量(Tq、Tw、Tc、Tr、Tt)以及所有 TCP/IP 通信?
我正在使用来自 couchdb 项目的以下haproxy.cfg:
global
maxconn 512
spread-checks 5
defaults
mode http
log global
monitor-uri /_haproxy_health_check
option log-health-checks
option httplog
balance roundrobin
option forwardfor
option redispatch
retries 4
option http-server-close
timeout client 150000
timeout server 3600000
timeout connect 500
stats enable
stats scope .
stats uri /_stats
frontend http-in
# This requires HAProxy 1.5.x
# bind *:$HAPROXY_PORT
bind *:5984
default_backend couchdbs
backend couchdbs
server couchdb1 127.0.0.1:15984 check inter 5s
server couchdb2 127.0.0.1:25984 check inter 5s
server couchdb3 127.0.0.1:35984 check …
Run Code Online (Sandbox Code Playgroud) 据我了解,Tq 时间是 TCP 客户端握手结束与读取最后一个 HTTP 标头之间的时间。
haxproxy 1.4 手册将 Tq 时间描述为:
Tq:获取客户端请求的总时间(仅限 HTTP 模式)。它是从接受客户端连接到代理收到最后一个 HTTP 标头之间经过的时间。值“-1”表示从未见过标题的结尾(空行)。当客户端过早关闭或超时时会发生这种情况。
来源:http : //www.haproxy.org/download/1.4/doc/configuration.txt
我想了解如何为持久连接记录 Tq。我的理解是否正确,如下图所示?
Tq timer start
|
v
[CON] [REQ1: HTTP HEADERS|HTTP DATA] ... [RESP1] [REQ2: HTTP HEADERS|HTTP DATA] ...
^ ^ ^
| | |
+-- REQ1 Tq time ---+ |
| |
+-------------------- REQ 2 Tq time ---------------------------+
Run Code Online (Sandbox Code Playgroud)
即当 haproxy 处理持久连接时,Tq 时间会随着同一连接上的每个请求而增加吗?