Re: [squid-users] cache dir equation + Misc questions?

From: Colin Campbell <sgcccdc@dont-contact.us>
Date: Fri, 12 Apr 2002 14:19:22 +1000 (EST)

Hi,

A search of the archives will reveal that the second level dirs should be
256 (maybe 254 on Linux) and nothing else. I believe it's based on how
many directory entries fit in one disk block.

SO, if you have x top level dirs and 256 second level dirs you get:

        256 cache objects per 2nd level dir, and therefore
        256 * 256 cache objects per top level dir, and therefore
        x * 256 * 256 total objects

If each object is the average size (see squid.conf) of 13kBytes then you
need at least

        13 * x * 256 * 256 kBytes, or
        13 * x * 64 MBytes of storage

Depending on how big "x" is, you will want 10% or 20% or 30% slack in the
total cache dir size to allow for large objects which get downloaded,
buffered in the cache but not kept (eg a CD image).

The last widely accepted "fact" I can give you is that you will probably
want to tune your cache size so that the "Storage LRU Expiration Age" (or
whatever - see General Runtime Info in cachemgr.cgi, or client mgr:info)
is arond one week. If it's more than this you are wasting storage. If it's
less you have too little and are turning over your cache objects too
quickly.

On Fri, 12 Apr 2002, Anthony Giggins wrote:

> Is there a cache_dir equation to work out the most efficient use of 1st and
> 2nd level directories? I'm running a large cache ie. 60GB and I find
> that my first and second level Directories fill-up and as a result proxy
> access slows down. The cache volume is no where near full. Ie about 13GB
> after about 100Days Usage and we average between 0.5 - 1 GB per day.
>
> cache_dir ufs /cache 60000 128 156
>
> most other options are just the defaults
>
> I'm running squid 2.3.STABLE4 on redhat Linnux 7.1
>
> Any help would be great.
>
> Anthony Giggins
>

Colin
Received on Thu Apr 11 2002 - 22:19:36 MDT

This archive was generated by hypermail pre-2.1.9 : Tue Dec 09 2003 - 17:07:32 MST