Re: Squid Memory Usage

From: Henrik Nordstrom <hno@dont-contact.us>
Date: Tue, 16 Feb 1999 00:26:45 +0100

Jens-S. Voeckler wrote:

> Hmm, I didn't see any difference for MISSes when I activated the Solaris
> "forcedirectio" mount option (since 2.6) which is said to transfer from
> user memory to io without a kernel copy. But then, (a) it was a lab
> environment and (b) I didn't look at the effects on HITs, because I was
> banging an empty Squid.

An empty Squid behaves quite differently from a stuffed one.. this I
know for sure from my Squid test runs. Nothing gets interesting until
the store is beginning to get reused in terms of reclaimed disk space
and cache hits.

> Judging by what you explained on cache_mem, I should *not* use that mount
> option, because the kernel buffer cache is actually my object store (for
> larger objects)?

Apparently it is hard to tell when to use that option and when not. I
guess this depends very much on what the hot set really consists of
(objects smaller than 8KB or larger objects), and how the usage pattern
of the hot set is. If hot objects are small and frequently fetched fron
the source (changing often or many users pushing shift+reload button)
then you will most likely benefit from turning off disk buffering and
use a much larger cache_mem instead. Worst case is if a number of larger
files get "hot", or if users are to well behaved and at the same time
causes medium hot (or cold) objects to become hot while still being
fresh in the cache.

Relying on Squids current implementation of cache_mem is quite
singleminded and not adopting to changed behaviour. Using the OS disk
buffer requires more memory but adopts automatically to changes.

Perhaps the optimal is to have a buffer which only buffers reads, and
sends writes straight to disk without buffering. Unfortunately this is
not a currently available option in any known configurations.

/Henrik
Received on Mon Feb 15 1999 - 17:25:52 MST

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