3

From what I understand, the Tq time is the time between the end of the TCP client handshake and the time that the last HTTP header is read.

The haxproxy 1.4 manual describes Tq time as:

Tq: total time to get the client request (HTTP mode only). It's the time elapsed between the moment the client connection was accepted and the moment the proxy received the last HTTP header. The value "-1" indicates that the end of headers (empty line) has never been seen. This happens when the client closes prematurely or times out.

Source: http://www.haproxy.org/download/1.4/doc/configuration.txt

I would like to understand how Tq is recorded for persistent connections. Is my understanding correct as indicated by my diagram below?

Tq timer start
     |
     v
[CON] [REQ1: HTTP HEADERS|HTTP DATA] ... [RESP1] [REQ2: HTTP HEADERS|HTTP DATA] ...
     ^                   ^                                          ^
     |                   |                                          |
     +-- REQ1 Tq time ---+                                          |
     |                                                              |
     +-------------------- REQ 2 Tq time ---------------------------+

I.e. when haproxy is dealing with persistent connections, the Tq time will increase with each Request over the same connection?

Chris Snow
  • 325
  • 2
  • 3
  • 16

1 Answers1

5

No, for persistent connections, Tq will be the time between when the previous response was completed and the current request was received. The counter resets after completing a response.

So large Tq values may indicate simply that the client was sitting there idle and not sending any requests.

You can confirm this yourself by experimenting - use nc or openssl to connect to your server and make requests at different intervals.

Ivan Stoyanov
  • 66
  • 1
  • 2