0

I am noticing a large discrepancy between TTFB in my browser networking tool and the HAProxy logs. HAProxy will say the request returned in 29 ms for example, but the browser reports anywhere from 50-600ms. I'm noticing this when traffic is the heaviest. The HAProxy server has 8 cores and 1gb networking connection on bare metal so I do not think its a limitation of the machine, but instead tuning that I can't figure out how to sort.

For example here is a line from the HAProxy Log (option httplog)

Jan 14 01:51:06 localhost haproxy[258127]: 555.555.555.555:59310 [14/Jan/2022:01:51:06.900] https-www~ ngt/api_srv_3 0/0/0/29/29 200 645 - - ---- 316/316/3/3/0 0/0 "GET [URL] HTTP/1.1"

The TTFB in Chrome and Brave shows anywhere from 50-600ms. 50ms makes sense but 600ms does not. Is there something I am overlooking for the discrepency? The times it corresponds to 600ms tends to coincide with busier times of the day, but the HAProxy log will still show 29ms for example.

Thank you in advance

FinDev
  • 123
  • 4

1 Answers1

1

TTFB in a browser and Tr in HAProxy logs are different metrics. TTFB in a browser includes the time required to perform DNS resolution, time for the request to travel from the browser to the HAProxy and time for the first packet of the HAProxy response to travel from the HAProxy to the browser.

AlexD
  • 8,747
  • 2
  • 29
  • 38