[squid-users] How to prevent Squid to use more and more HD space in virtualbox

Alex Rousskov rousskov at measurement-factory.com
Fri Nov 19 22:51:32 UTC 2021


On 11/19/21 2:45 PM, Graminsta wrote:

> I have a problem with the continuous increase in disk space usage on
> linux where squid is hosted. Even having turned off the cache
> ("#cache_dir ufs /var/spool/squid/ 1000 16 256").

This is unrelated to your question, but please note that removing
cache_dir directives disables disk caching but not memory caching.
Memory caching does not consume disk space, but if you want to disable
memory caching as well, use "cache_mem 0".
  

> VMs starts at 7gb and in a few weeks grows to 10...20...30Gb.
> 
> Why does Squid need so much growing hard drive space

There could be several reasons, but the most common one is logging.
There are several kinds of logs (cache_log, access_log, icap_log, etc.).
You should find out which ones are growing beyond your expectations in
your environment. Look for files that are actively growing in size on
the disk partition that grows in size (e.g., some logs are often found
in /use/local/squid/var/logs or similar directories).

If logs are not the reason for excessive disk usage, then I would check
for coredump files (with unique file names).


> and how to prevent it?

0. If you start your Squid with "-X" command line option, then stop
doing that. That option enables extensive debugging that goes into
cache_log. It is meant for triage sessions only.

1. If you set "debug_options" to anything other than "ALL,1", then
either set it to ALL,1 or remove all debug_options lines. The default is
ALL,1.

2. Rotate your logs as needed. There is some good advice in the Squid
FAQ[F], but since some of the wiki pages are quite all/stale, use common
sense and best sysadmin practices.

[F] https://wiki.squid-cache.org/SquidFaq/SquidLogs


3. If your Squids are crashing (and leaving coredumps with unique file
names), then fixing Squid or removing crash triggers is usually the best
way forward.


HTH,

Alex.


More information about the squid-users mailing list