Re: Defining a cache_dir

From: Colin Campbell <sgcccdc@dont-contact.us>
Date: Wed, 8 Dec 1999 08:57:07 +1000 (EST)

Hi,

This is my understanding of the process. Someone PLEASE correct me if I am
wrong.

1. squid will create Y files in the Y 2nd level directories
2. squid estimates how many files it can store by dividing the size of the
cache by the "average object size" of 13kbytes (defined in squid.conf) and
then doubling it. ie

        3700 * 1024 * 2 / 13 = 582656 files

(I believe the "2" is there as a safety factor allowing your average
object size to drop to 6.5kb without running out of bits in the file
mask.)

So, with this information:

if Y = 256 then X must be >= 9 to provide enough directories and files
(since X x Y x Y = 9 x 256 x 256 = 589824).

By trying different values of Y, you can get an "optimal" value of X

Y = 64 requires X >= 143
Y = 128 requires X >= 36

However, I get the feeling from various postings on this subject that
squid "prefers" (or "works best") with Y = 256.

Colin

On Tue, 7 Dec 1999, Leonardo Rodrigues wrote:

>
> People, which are the 'best' numbers of X and Y on a cache_dir line ??
>
> cache_dir /var/cache 3700 X Y
>
> Which is the best value for them ? How do I calculate them ?
>
> I know they are first 1st Level Directory and 2nd Level. I wanna know how
> to discover them.
>

--
Colin Campbell
Unix Support/Postmaster/Hostmaster
CITEC
+61 7 3227 7112
Received on Tue Dec 07 1999 - 16:05:06 MST

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