0

I have some squid servers, which I monitor with the squidclient mgr:5min command. I would like to monitor http service time with;

squidclient mgr:5min | grep "client_http.all_median_svc_time"

However, the time is very high when the method is CONNECT;

10.10.10.10 - - [26/Oct/2016:09:18:33 +0100] "CONNECT remote-domain.com:443 HTTP/1.1" 200 805 30564 "-" "-" TCP_MISS:DIRECT

(Where 30564 = %tr = Time to serve the request, in millisecond)

Because of this, it is difficult to monitor, because these CONNECT requests bring the 5 minute average up over 30 seconds sometimes.

Is there a way to have the squidclient command ignore CONNECT mothod requests......or any other suggestions on how I could monitor service times.

I have seen this question, Squid HTTPS Tunnelling using CONNECT very slow, but I dont think it is a slowness issue, just that the CONNECT method stays connected for longer (I could be wrong on this) Thanks in advance

1 Answers1

0

FYI: I dont think it is possible to monitor without CONNECT methods, so I implemented a workaround. I tail the last 100 lines of the log file, and if there are more CONNECT messages than others, I set the client_http.all_median_svc_time to 0

RESULT=$(squidclient -h localhost mgr:5min)
CONNECT_RATIO=$(expr $(tail -n 50 access.log | grep -v CONNECT | wc -l) - $(tail -n 50 access.log | grep CONNECT | wc -l))

if [ $CONNECT_RATIO -lt 0 ]
then
  ClientServiceTimeAVG=0
else
  ClientServiceTimeAVG=$(echo "$RESULT" | grep "client_http.all_median_svc_time" | grep -Po '[0-9]+\.[0-9]+')
fi