November 27, 2014
 
 
RSSRSS feed

Do-It-Yourself Caching: Squid 2.3 - page 6

Why Caching is Essential

  • February 29, 2000
  • By Lisa Phifer

Many admins will do what we did: make a few obvious squid.conf changes after the initial install, then let Squid run for awhile and observe what happens. Among our initial tuning changes:

acl QUERY urlpath_regex cgi-bin
no_cache deny QUERY ����
maximum_object_size 4096 KB �����
cache_access_log /dev/null����
cache_store_log none ���
debug_options ALL,1 ����
ftp_user Squid@dps.corecom.com ���
quick_abort_min 16 KB ����
quick_abort_pct 95 ���

#Avoid caching cgi scripts
#Limit the largest cacheable object
#Disable client logfile (requires restart)
#Disable object logfile
#Establish minimum debug level
#Define anonymous user for FTP caching
#Allow server to abort if requesting client aborts #But continue if less than 16 KB left or 95+% done

Before disabling logs, we started a Polygraph workload and monitored the access.log. But with an active workload, these logs grew large and quickly consumed all available space in their default location /usr/local/squid/logs. We then set cache_access_log none, but this only created a file called none! In fact, you can't stop Squid from recording client access, but you can avoid writing the log to disk by sending output to /dev/null. You can also better manage disk space by placing your log files in another partition, invoking squid -k rotate periodically in a cron job and transferring old files elsewhere.

Once we brought disk usage under control by tweaking cache_disk and log settings, our next challenge was memory. The config option cache_mem affects how much RAM is used by in-transit, hot and negatively cached objects, but if Squid needs more memory for in-transit objects, it will use it despite any limit you set here.

And there is no config option to limit Squid process size: cache_mem is only one way Squid consumes RAM; others uses include disk and network I/O buffers, IP and FQDN cache, per-request state information (including request and reply headers) and statistics. You can monitor Squid memory usage with Cache Manager. Our general stats showed 55 KB in use when we'd configured cache_mem 32 KB. Squid developers have been working to eliminate memory leaks; check the FAQ for hints on how to reduce usage and avoid leaks.

Sitemap | Contact Us