[squid-users] how to obtain info about actual active downloads?

Frantisek Hanzlik franta at hanzlici.cz
Mon Oct 27 13:32:39 UTC 2014


Please, what is best way for determining who squid clients (their
PC IP addresses) have which downloads active?
I want it to determine which clients burden our slow internet line.
Examining 'access.log' does not help much in this case, because users
can download large files and it may take a few minutes or hours (e.g.
in case of consuming some audio/video streams).

I tried inspecting informations in 'Client-side Active Requests' menu
in cachemgr.cgi, where are paragraphs as:

Connection: 0x7f442037aa48
	FD 94, read 5892, wrote 148211583
	FD desc: Reading next request
	in: buf 0x7f440efc9150, offset 0, size 4096
	remote: 192.168.1.44:1631
	local: 192.168.1.254:3128
	nrequests: 7
uri http://ice.abradio.cz/prachen64.mp3
logType TCP_MISS
out.offset 148178800, out.size 148179207
req_sz 724
entry 0x7f440d5d6220/A1AD3A830E803B23F9295A9BCB9C1949
start 1414389495.929684 (18515.473233 seconds ago)
username
delay_pool 0

which seems to contain the necessary items and it would not be a big
problem adjust them to shorter form using e.g. awk or sed script,
and this informations is possible obtain in batch with some as:

wget -q -O - 'http://localhost/Squid/cgi-bin/cachemgr.cgi?host=localhost&port=3128&user_name=&operation=active_requests'
or
lynx -dump 'http://localhost/Squid/cgi-bin/cachemgr.cgi?host=localhost&port=3128&user_name=&operation=active_requests'

But is this the correct way? Or Squid offers other tools for this
case? Or is possible cachemgr.cgi supply/enwrap with some filter
which output needed info in some customized format?
We are using squid-3.3.13/Linux i686 now, it run on our LAN internet
router, LAN has approx. twenty PCs.

Thanks in advance, Franta Hanzlik



More information about the squid-users mailing list