Re: [squid-users] cache_dir configuration

From: Colin Campbell <sgcccdc@dont-contact.us>
Date: Mon, 18 Jun 2001 08:28:35 +1000 (EST)

Hi,

On Fri, 15 Jun 2001 Torsten.Lange@GECITS-EU.COM wrote:

> cache_dir size in mb:
> -----
>
> dfn equation:
> 95% * GB_available * 1024 = cache_dir_MBvalue
>
> with my values:
> 0.95 * 10 * 1024 = 9728
>
> subsequently, i shall have 'cache_dir /cache1 9728 xx xxx'

There was a very recent thread on this list that suggests having more than
one cache per spindle, can under some circumstances, be beneficial.
Apparently diskd can benefit from this. Using aufs will gain no benefit
from multiple cache_dirs per spindle. (Thanks to kinkie and Henrik)

> cache_dir directory parameters L1 and L2:
> ----
>
> dfn equation:
> L1=ceil(15564/416)
>
> with my values:
> L1=ceil(9728/416) = 24

This calulation is based on providing enough storage for 13kbyte objects
and then doubling it for saftey. You may want to reconsider.

You can hold L1 * L2 * L2 objects in the cache (each L2 directory holds
256 objects). If they are 13kB (default average object size in squid.conf)
in size you will need L1 * L2 * L2 * 13 kbytes of storage. You should
allow a safety factor > 1. If you choose 2 then you need 2 * L1 * L2 * L2
* 13 kbytes of storage. Since you know L2 and the total storage

L1 = safety_factor * (cache_dir size in kbytes) / (L2 * L2 * 13)
   = 2 * (9728 * 1024) / (256 * 256 * 13)
   = 9728 / 416
   = 23.384615
   -> 24

> dfn says it is okay to modify the L1 parameter while leaving the L2 value
> untouched.

Correct. The "256" is a "magic" number based on the number of inodes that
fit in a page of memory (I think).

Colin
Received on Sun Jun 17 2001 - 16:28:48 MDT

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