14

I'm trying to understand more about the Haproxy timings. Below is a snippet of the timings from the Haproxy manual:

  • Tq: total time to get the client request (HTTP mode only)...

  • Tw: total time spent in the queues waiting for a connection slot...

  • Tc: total time to establish the TCP connection to the server....

  • Tr: server response time (HTTP mode only)...

  • Tt: total session duration time, between the moment the proxy accepted it and the moment both ends were closed...

Source: http://cbonte.github.io/haproxy-dconv/configuration-1.5.html#8.4

I've attempted to diagram some of the timings, but my diagram is probably incorrect and is definitely incomplete (no FIN, etc):

enter image description here

Question: What would the full timing diagram look like, including all timing measures (Tq, Tw, Tc, Tr, Tt) as well as all TCP/IP communications?

Chris Snow
  • 325
  • 2
  • 3
  • 16
  • I think Tr starts after Tc finishes. Does haproxy wait for the full request before starting a backend connection? Tw might start earlier. – chicks Dec 10 '14 at 16:32
  • Thanks for making this diagram. What did you draw it in? – chicks Dec 10 '14 at 16:34
  • @chicks - I used [Dia](http://dia-installer.de/) – Chris Snow Dec 10 '14 at 16:42
  • @chicks - please assume my diagram is incorrect :) - I only added the diagram to show how I am thinking about the timings. – Chris Snow Dec 10 '14 at 16:43
  • I was trying to make useful suggestions, not presuming anything. It is cool that you used dia for this. I like dia for my database diagrams. – chicks Dec 10 '14 at 19:46

3 Answers3

7

Nice picture :)

  • timeout connect is on server side, it is the maximum time to run the TCP handshake
  • http-request starts from the ACK on the client side until whole HTTP headers have been received
  • Tq starts from the client Handshake TCP.
  • Tr is until we receive the response Headers

Baptiste

Baptiste
  • 316
  • 1
  • 2
  • 1
    thanks for the info, however, I was hoping for a complete timing diagram including all measures, and also showing all the TCP session setup and tear down. Are you part of the Haproxy development team? – Chris Snow Dec 15 '14 at 09:50
  • on a HTTPS session, the Tq timer starts after the TCP handshake finishes and before the SSL handshake starts? – Chris Snow Sep 07 '15 at 11:51
1

Based on official docs, Here I created a brief and precise answer.

enter image description here

Tq:
    - total time to get the client request from the accept date (Th + Ti + TR)
    TH: total time to accept tcp connection and execute handshakes
    Ti: is the idle time before the HTTP request
    TR: total time to get the client request
    
Tw: the time needed for the server to complete previous requests
Tc: between the moment the proxy sent the connection request, and the moment it was acknowledged by the server
Tr: between the moment the TCP connection was established to the server and the moment the server sent its complete response headers.
1

Newer versions of the HAProxy Configuration Manual include a diagram of the timer sequence: 8.4 Timing Events

anthony
  • 111
  • 4