• This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn more.

Squid hit rate

balanga

Daemon

Thanks: 62
Messages: 1,999

#1
How can I measure performance of my Squid proxy server?

I keep downloading many of the same files but never seem to see a speed up. My Internet connection is pretty slow, so I would have thought that Squid's cache would drastically speed things up. I get the impression that my cache isn't being used at all...
 

DutchDaemon

Administrator
Staff member
Administrator
Moderator
Developer

Thanks: 2,591
Best answers: 2
Messages: 11,184

#2
I remember a graphical statistics program for Squid, but I'll have to go down memory lane to come up with that (later). There are also command-line tools in squidclient, like squidclient -p <port> mgr:info (which you may have to configure/enable, don't quite remember).

Edit: ah yes, www/calamaris and www/sarg. Untested by me: www/squidanalyzer.
 

SirDice

Administrator
Staff member
Administrator
Moderator

Thanks: 5,998
Best answers: 11
Messages: 26,762

#3
You can also check the various logs from squid, if I remember correctly it has a log specific for cache hits/misses.

I keep downloading many of the same files but never seem to see a speed up. My Internet connection is pretty slow, so I would have thought that Squid's cache would drastically speed things up. I get the impression that my cache isn't being used at all...
Keep in mind that HTTPS connections are never cached.
 

PacketMan

Aspiring Daemon

Thanks: 131
Messages: 857

#4
I ran squid at my house for a while and and the grand scheme of things it won;t make that much difference. A lot of www sites have implemented https which can't be cached (unless you break some http man-in-the-middle rules), and even for the http sites many have implemented http code to reduce caching. You can easily override those settings and that will get your cache hit rate up. But even then you're hit rate will still be lowish. I created a 10GB cache to hold lots of stuff and that helped, but in the end I turned it off as it was eating up a fair bit of ram. When I get my new system bought (I am waiting for reasons) with 16GB ram to start I might try squid again. Ultimatly I did it for learning and curiosity so goal acheived. ;)

In a service provider or enterprise environment you will see higher hit rates in theory, but https still kills caching there too.
 

ronaldlees

Aspiring Daemon

Thanks: 247
Best answers: 2
Messages: 639

#5
I've found that simple shell scripts can examine the squid logs very well. This guy has some ready-made scripts on his site:

http://blog.davidvassallo.me/2011/05/19/analyzing-squid-access-logs/

Anyway, squid doesn't cache very big files, so with images getting so big these days, less is cached. I think it may be a tunable parameter though. The squid logs can really tell you many things about what you're pulling down from sites - and it can be a real eye opener in terms of site traffic versus ad traffic, etc. David's scripts really nail the details on this.
 
Top