Deleting UFS cache files directly

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

Deleting UFS cache files directly

RW-8
With UFS, is it possible to manually delete cache files without causing
problems? If so, is there any action that should be taken to have
squid pick-up the changes?

What I was thinking of doing is periodically running something like:

  find /usr/local/squid/cache/?? -type f -atime +2d -size +2M -delete

to remove large files.

Alternately is there a utility that can do this kind of thing?


Reply | Threaded
Open this post in threaded view
|

Re: Deleting UFS cache files directly

Amos Jeffries
Administrator
> With UFS, is it possible to manually delete cache files without causing
> problems? If so, is there any action that should be taken to have
> squid pick-up the changes?
>
> What I was thinking of doing is periodically running something like:
>
>   find /usr/local/squid/cache/?? -type f -atime +2d -size +2M -delete
>
> to remove large files.
>
> Alternately is there a utility that can do this kind of thing?
>

cachemgr.cgi and squidclient are provided along with the squid
installation to assist with things like this.

Amos

Reply | Threaded
Open this post in threaded view
|

Re: Deleting UFS cache files directly

Henrik Nordström
In reply to this post by RW-8
On sön, 2007-07-22 at 21:25 +0100, RW wrote:

> With UFS, is it possible to manually delete cache files without causing
> problems? If so, is there any action that should be taken to have
> squid pick-up the changes?
>
> What I was thinking of doing is periodically running something like:
>
>   find /usr/local/squid/cache/?? -type f -atime +2d -size +2M -delete
>
> to remove large files.
>
> Alternately is there a utility that can do this kind of thing?
Why do you want to do this? Squid maintains the cache automatically..

From your description it sounds like you might want to look into using
the heap GDSF replacement policy.

If you really want to delete stuff manually then look into using the
purge utility (see related software).

Regards
Henrik

signature.asc (316 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: Deleting UFS cache files directly

RW-8
On Mon, 23 Jul 2007 00:12:11 +0200
Henrik Nordstrom <[hidden email]> wrote:


> Why do you want to do this? Squid maintains the cache
> automatically..  

I find that larger files are only worth caching for a short time
because if there's a chance I might want them again I'll save them
(out of the cache).

> From your description it sounds like you might want to look into using
> the heap GDSF replacement policy.
>  
I had a cursory look at the heap policy implementations and got the
impression that the heap keys are recomputed when the squid process
starts-up.  If that's correct then the LFUDA and GDSF implementations
are only really suitable for systems with very long squid up-times. In
my case I turn my PC off on most nights rendering the aging mechanism
useless.

> If you really want to delete stuff manually then look into using the
> purge utility (see related software).  

AFAIK purge only deletes by URL, not combinations of age and size.
"purge -ve." can generate a very detailed object listing though, which
might be useful if I ever get around to writing a script.