Re: HELP!: Recompile MAX_SWAP_FILE size?

From: Henrik Nordstrom <>
Date: Sat, 10 Jan 1998 02:10:14 +0100

Bill Wichers wrote:
> It appears to be statically related to the value you set for
> cache_swap.


MAX_SWAP_FILE = cache_swap / average_object_size * 3 / 2.

3 / 2 == 1.50 is a 50% margin to allow for some extreme cases, but since
the real-life average object since seems to be 13K and not 20K as set in
the default squid.conf the default calculated value is not high enought.

Set average object size to 13K and you should be safe (even to extreme

> December 20th or so). I'm surprised there was no big warning
> in the Squid distribution.

Since noone did foresee that this "trivial" change should cause so much
pain. The change was done to save quite a bit of memory in small caches
(where memory is most important), but as we all know by now it had some
bad touches..

* The default average object size setting of 20K is way to high, causing
all caches to fail when filled regardless of cache size. Setting average
object size to 13 fixes this.

* When upgrading from a earlier version you have to clean your cache.
Since the range of the cache-file numbers is much smaller than it was
before, it renders large parts of a existing cache directory useless
while still using diskspace. The diskspace is not reclaimed until you
manually delete the lost objects. No fix other than wiping the whole
cache before upgrading.

Henrik Nordström
Sparetime Squid Hacker
Received on Fri Jan 09 1998 - 17:53:43 MST

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