Re: giving right size for cache_dir config

From: David S. Madole <david@dont-contact.us>
Date: Wed, 09 Jun 1999 17:51:25 -0400

Thierry CAILLET wrote:
>
> On my FreeBSD 3.1 Box, my disk are declared rw,async,noatime in fstab and
> a tunefs -m 0 has been made to recover 8% of the disk.
>
> But how can i calculate the exact size to give for cache_dir parameter ?
> ( a disk full error have already occured, and we losed the objects )

I have done something similar, my cache_dir parameters are set to about
90% of the disk volume, which results in about 91-92% filling with
filesystem overhead for directories, etc. I found it worked out better
to let squid manage the 8% free space on the drive than the OS.

I suppose that alternatively to what I have done, you could set the
cache_dir to the real volume size and cache_swap to 89% and 90%. I
prefer the way the squid stats read this way, though. What I consider
"full" shows up as 100%.

In any case, don't try to fill your disks completely. It's not worth it.

This configuration has been stable for over a year. Here's the
specifics:

net1#df -k
Filesystem 1K-blocks Used Avail Capacity Mounted on
/dev/da1s1a 197951 15358 166757 8% /
/dev/da1s1g 595839 229727 318445 42% /usr
/dev/da0s1d 992751 5307 908024 1% /var
/dev/da1s1d 992751 325551 587780 36% /tmp
/dev/da0s1h 1986495 683245 1144331 37% /var/log
/dev/da1s1h 1986495 61137 1766439 3% /var/spool
/dev/da0s1e 3973982 3612303 361679 91% /var/spool/squid/00
/dev/da1s1e 3973982 3612286 361696 91% /var/spool/squid/01
/dev/da0s1f 3973982 3612748 361234 91% /var/spool/squid/02
/dev/da1s1f 3973982 3612095 361887 91% /var/spool/squid/03

net1#egrep "cache_(dir|swap)" squid.conf
cache_dir /var/spool/squid/00 3500 16 256
cache_dir /var/spool/squid/01 3500 16 256
cache_dir /var/spool/squid/02 3500 16 256
cache_dir /var/spool/squid/03 3500 16 256
cache_swap_high 100
cache_swap_low 99

net1#tunefs -p /dev/rda0s1e
tunefs: soft updates: (-n) disabled
tunefs: maximum contiguous block count: (-a) 7
tunefs: rotational delay between contiguous blocks: (-d) 0 ms
tunefs: maximum blocks per file in a cylinder group: (-e) 2048
tunefs: minimum percentage of free space: (-m) 0%
tunefs: optimization preference: (-o) time
tunefs: should optimize for space with minfree < 8%
Received on Wed Jun 09 1999 - 15:37:37 MDT

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