Re: [squid-users] How can I clean out old objects - refresh patt

From: Ding Deng <ding.deng@dont-contact.us>
Date: Wed, 19 Sep 2007 12:53:34 +0800

Adrian Chadd <adrian@creative.net.au> writes:

> On Tue, Sep 18, 2007, Nicole wrote:
>
>> Thanks for the clarification, but Eeek!
>
> Whats eek about it!
>
>> So then, I guess this raises the question: If you have plenty of
>> disk, there really is nothing from keeping ancient files hanging
>> around, using up space and enlarging your swap.state file?
>
> Squid will clean it for you! Relax.
>
>> I thought it was an either not enough space Or older than expire
>> time would delete objects.
>
> It'd mean more RAM used to track expired objects, and more CPU to walk
> the list and delete unneeded objects..

And probably longer disk seek time.

>> So it seems like, I either have to manually purge old files every so
>> often, or set my disk space artificially to prevent too many objects
>> based on my servers's memory or increase my memory?
>
> Nope, you just need to:
>
> * cron a squid -k rotate once a day to make sure swap.state (and your
> other log files) don't grow to infinity! So many people forget this
> step.
>
> * Relax, and let squid handle deleting files when it wants to. It'll
> delete old files to make room for others as appropriate!

Agreed. We still have to make sure that cache_dirs match server memory
however, as I'm seeing a scenario right now that if we make full use of
all the available disks, a single Squid instance will eat up dozens of
gigabytes of physical memory, which is far more than what we've
installed on the server.

I'm also seeing a scenario that 10GB of cache_dirs get roughly the same
hit ratio as 30GB of cache_dirs due to cache pollution, so cache_dir
which is larger than necessary is not always a good idea.

> Now, the question you should be asking is "will legitimate but
> infrequently used files be deleted in preference to "stale" files, and
> will this make my disk use suboptimal?"
>
> The answer, thankfully, is no - if you think about it, if a file is
> stale then:
>
> * it hasn't been accessed in a while (or its freshness would've been
> "updated" and it suddenly isn't stale/expired anymore!, and
>
> * if it hasn't been accessed in a while, it'll be at the tail end of
> the LRU or Heap anyway.
>
>
> Adrian
>
> --
> - Xenion - http://www.xenion.com.au/ - VPS Hosting - Commercial Squid Support -
> - $25/pm entry-level bandwidth-capped VPSes available in WA -
Received on Tue Sep 18 2007 - 22:53:53 MDT

This archive was generated by hypermail pre-2.1.9 : Mon Oct 01 2007 - 12:00:02 MDT