Score:0

HAProxy - http log and TTFB discrepency

in flag

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

jp flag
There is network between haproxy and a browser and it has its own latency.
Score:1
jp flag

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.

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.