[squid-users] Debugging a slow Squid?

Alex Rousskov rousskov at measurement-factory.com
Sat Nov 28 16:23:34 UTC 2020


On 11/28/20 7:00 AM, roee klinger wrote:

> I am aware of the <tr> in the Squid log, but does it show the time it
> took Squid to process the request or does it also include the time it
> took the request to even get to Squid (for example the time from the
> router to Squid, from the user to the router, etc)?

Overall, do not expect Squid to measure what happens before the HTTP
request header is received. Squid could (and should and eventually will)
measure more than it does now when it comes to the beginning of the
transaction, but often there is just not enough information to measure
the client-Squid propagation/communication delay for the initial TCP
packet(s) or for the initial HTTP request packet on a previously used
persistent connection.

Specifically, %tr logformat code logs the difference between master
transaction start time and master transaction logging time.

* According to %tS documentation, Squid currently considers the master
transaction started when a complete HTTP request header initiating the
transaction is received from the client.

* Currently, Squid logs the master transaction when the client-Squid
transaction that was handling the client HTTP request gets destroyed.
Usually, that destruction happens when Squid receives the entire request
from the client and sends the entire response to that client.



> What would be the best way to isolate, inspect, and improve Squid
> performance, regardless of network performance?

One could write a book answering this question, but I would start by
running atop to exclude system bottlenecks (memory, CPU, disk) first.
Once system/global bottlenecks are eliminated, you may be able to detect
processing stages that slow down the transaction the most by sending
representative test requests.


HTH,

Alex.


More information about the squid-users mailing list