SQUID folder size becomes large

General support questions
Post Reply
jjmbdpl
Posts: 7
Joined: 2017/10/05 12:35:50

SQUID folder size becomes large

Post by jjmbdpl » 2017/11/23 03:39:36

Dear All,
I am facing problem on SQUID PROXY.
Please see my attached file.I want to delete all files.Is it will be problem if I delete all files ?
My HDD becomes full. How I can recover this without problem my proxy users.
Attachments
Squid-Folder-Size.jpg
Squid-Folder-Size.jpg (34.8 KiB) Viewed 4388 times

pjsr2
Posts: 614
Joined: 2014/03/27 20:11:07

Re: SQUID folder size becomes large

Post by pjsr2 » 2017/11/23 22:31:41

You can specify the maximum size of the cache in the cache_dir configuration parameter in the /etc/squid/squid.conf configration file.
If the cache_dir configuration parameter is not specified, it defaults to /var/spool/squid and unlimited size.
If you do not specify a limit, squid may fill up the entire disk partition.
See http://www.squid-cache.org/Doc/config/cache_dir/

As a rule of thumb, squid uses around 10 MB of memory per GB cached disk data. If you have a limited amount of memory available, you should also reduce the size of the cache_dir. So a good value for cache_dir depends on both the available disk space and the available memory.
See https://wiki.squid-cache.org/SquidFaq/S ... _server.3F

You can also disable caching entirely by specifying:

Code: Select all

cache deby all

desertcat
Posts: 843
Joined: 2014/08/07 02:17:29
Location: Tucson, AZ

Re: SQUID folder size becomes large

Post by desertcat » 2017/11/24 05:52:49

I noticed that this is in /var. A few questions:

1) Is /var an independent partition or is part of a gigantic partition under LVM?
2) If an independent partition how much space did you allocate to /var ?
3) Is /var/spool/squid in a scheduled log rotation ?

You could *possibly* copy those files to a thumb drive or some place for temporary holding should you decide to delete them. I'd ask one of the gurus here if that would be safe -- should you delete them and the system need them then you simply need to copy the files back into place.

I had a similar problem with /var/log/Xorg.0.log and the problem had to do with gdm. The problem was solved by switching from gdm to sddm. I have not had the problem of the run away growth with /var/log/Xorg.0.log. since. It took about two weeks to find that solution trying to figure out what was causing the problem and then formulating if I could substitute it with something else. Chances are that some process that squid depends on was updated and that is what lies at the heart of your problem. You may need to view a lot of log files etc.

If all else fails see if you can set it up as a cron job or that you can set the parameters that the file is on a rolling structure that allows the file to expand but at the same time drops off the oldest data that way the various files will be a constant size.

Hope this helps.

pjsr2
Posts: 614
Joined: 2014/03/27 20:11:07

Re: SQUID folder size becomes large

Post by pjsr2 » 2017/11/24 09:04:43

3) Is /var/spool/squid in a scheduled log rotation ?

You could *possibly* copy those files to a thumb drive or some place for temporary holding should you decide to delete them. I'd ask one of the gurus here if that would be safe -- should you delete them and the system need them then you simply need to copy the files back into place.
/var/spool/squid is not the location for squid log files. Those are in /var/log/squid. When you use the default configuration of squid, /var/spool/squid is used as the cache directory for content that is cached by the proxy server. The caching improves performance when multiple clients that communicate through the proxy, retrieve the same contents/documents. There is no reason to worry about backing up the contents of the cache directory. Missing documents will be retrieved from their original source when not found in the cache.

Squid has its own build-in cache manager. It has many tuning options. The most important is to always set a maximum on the cache_dir sizes when you allow caching. Note that this maximum sets the limit for the amount of cached data, but it is not including the disk space that squid needs to store the meta-data about the cached contents. This meta-data is stored in the same cache directory. When you enable caching in squid, it is probably best to create a separate partition for the cache so filling up the cache does not compete for disk space with other processes running on the same server. The maximum cache dir size should be set to well below the size of this partition to ensure enough space for the meta-data.

Also look at the options that squid has to limit the time that data is cached (squid configuration option "refresh_pattern").

Post Reply