Anda di halaman 1dari 1

How to analyze whether squid is performing well Users will always complain that Internet access is slow.

The problem is: can the y be trusted? Rarely. And the general availability of broadband at home has, if anything, made users even less reliable as a source of performance information a s it raises their performance expectations beyond what is reasonable in a work e nvironment. The first step is to quantify and measure the problem, since users almost always have a subjective (and not quantitative) view of what's going on. Try a simple test: on a test client system with enough network access permis sions, try accessing a test site or three of your choice, using a test pattern s uch as: clear browser cache, close all browser windows, open browser, access sit e without using the proxy, clear browser cache, close all browser windows, confi gure proxy, access site. Is there any noticeable performance difference? If not, then it's definitely not a problem with Squid. Check your cache.log, and look if it says anything strange, such as squid re starting unexpectedly or complaining about some resource being unavailable (for instance, is it low on file descriptors?) Check your uplink congestion rate. Is it congested? Squid can help with a co ngested uplink, but can't perform miracles. What about latencies? Do a tracerout e to a test site and check what is the performance on the first two-three hops: the problem might not be with your uplink, but with your provider's. Check your system performance: how much CPU time it spends running Squid, ho w much in the kernel, how much iowait, how much swap it is using, pagein and pag eout rates, etc. The system must be in a sane state for squid to have a chance t o perform. If you found nothing so far, fire up your cachemgr and look for performance indicators such as hit ratio (memory, object and DNS), DNS response time, number of available filedescriptors. If you're using authentication check the authenti cators' queues congestion - all these things add latency to a request handling, and that can generally make an user's browsing experience much worse. Repeat the analisys at different times in different days, check for variations i n the vital parameters. Collect a few days' worth of logs, and run on them a statistics software suc h as calamaris or webalizer, and start looking for deviations from "reasnonable" behaviour, such as users with unreasonably high bandwidth or request activities . Only at this point you should have a clear enough picture to know what knob to t urn in order to fix your problem. if there really is a problem. If everything so far points at squid being the source of the problems, try to follow the steps i n SquidFaq/SquidProfiling. What settings should I change? None, before having understood what is really going on. Some of the solutions could actually end up worsening the problem: for instance increasing cache_mem on a memory-bound system can actually be detrimental to ove rall squid performance: if you end up using more memory than your system has, pa rts of squid end up being swapped to disk trashing performance. In such cases it 's much better to actually reduce cache_mem.