jymbo
04-23-2004, 01:21 PM
Can someone give me the formula for calculating cache_dir and cache_mem in relation to system specs?
For example: I have PII450/128MB RAM/40GB ATA66 that will run Squid for a small business LAN of 4 Win2k clients.
This is the most I've been able to find out from Google:
x=Size of cache dir in KB (i.e. 6GB=~6,000,000KB) y=Average object size
(just use 13KB z=Number of directories per first level directory
(((x / y) / 256) / 256) * 2 = # of directories
As an example, I use 6GB of each of my 13GB drives, so:
6,000,000 / 13 = 461538.5 / 256 = 1802.9 / 256 = 7 * 2 = 14
So my cache_dir line would look like this:
cache_dir 6000 14 256
So for my purposes, I would like to allocate 3GB of disk space for cache. When I run the figures through the formula, I get a cache_dir value of: 3000 7 256.
What I need to know is:
1.) How much RAM do I need to support this amount of disk cache? Is my 128MB enough? Is there a formula for determining the optimal cache_dir size based on a total system RAM? If 128MB is insufficient to support a 3GB cache, how do I adjust the cache_dir to accomodate?
2.) What should I set my cache_mem value to based on my system specs/cache_dir?
Thanks.
For example: I have PII450/128MB RAM/40GB ATA66 that will run Squid for a small business LAN of 4 Win2k clients.
This is the most I've been able to find out from Google:
x=Size of cache dir in KB (i.e. 6GB=~6,000,000KB) y=Average object size
(just use 13KB z=Number of directories per first level directory
(((x / y) / 256) / 256) * 2 = # of directories
As an example, I use 6GB of each of my 13GB drives, so:
6,000,000 / 13 = 461538.5 / 256 = 1802.9 / 256 = 7 * 2 = 14
So my cache_dir line would look like this:
cache_dir 6000 14 256
So for my purposes, I would like to allocate 3GB of disk space for cache. When I run the figures through the formula, I get a cache_dir value of: 3000 7 256.
What I need to know is:
1.) How much RAM do I need to support this amount of disk cache? Is my 128MB enough? Is there a formula for determining the optimal cache_dir size based on a total system RAM? If 128MB is insufficient to support a 3GB cache, how do I adjust the cache_dir to accomodate?
2.) What should I set my cache_mem value to based on my system specs/cache_dir?
Thanks.