The Squid proxy server is one of the most popular Web proxy and cache servers around. When deployed correctly, Squid drastically reduces the load times and bandwidth usage for commonly accessed websites. On a small scale, Squid is easy to configure and control, but as the server's usage expands, you may need to implement a few optimisation techniques. With a few tweaks in the Squid server's configuration files, you can optimise your Squid server for high-performance.
Open your "/etc/squid/squid.conf" file in a text editor, such as Notepad. You will need to be root to access the file.
Change the "cache_mem" option from 8MB, the default, to 32MB. If your machine has memory available, raising this cache memory option can really improve performance. Some people will set this as high as 100MB or more.
Add the "half_closed_clients" option and set it to "Off" in the configuration file. Also, change the "maximum_object_size" option to "1024KB" for minor improvements.
Specify your DNS name servers using the "dns_nameserves" option. This is important since Squid gets held up with DNS lookups.
Add both the "cache_swap_low" and "cache_swap_high" options that help determine when Squid will begin to prune the cache. This is important for keeping the cache within reasonable, quickly-accessible limits.
Set the "memory_pools" option to "Off" so Squid will release any RAM the server isn't using back into the memory pool.
Tips and warnings
- Using the best hardware, such as 7200 RPM hard drives, for your Squid caches is important. However, using a journal file system like ReiserFS for your cache partitions can increase performance by 20 per cent as well. Consider buying new hardware or changing your file system type if you've applied configuration tweaks and the results aren't quite what you were expecting.
- 20 of the funniest online reviews ever
- 14 Biggest lies people tell in online dating sites
- Hilarious things Google thinks you're trying to search for