Re: Squids memory cache (cache_mem setting)

From: Jon Kay <jkay@dont-contact.us>
Date: Sun, 11 Jul 1999 22:58:32 +0000

Henrik Nordstrom wrote:
>
> Hossam El-Ashkar wrote:
> > . . . I am having a 1GB RAM machine. Won't increasing cache_mem be
> > profitable??
>
> Squid sometimes makes a very sub-optimal use of it's assigned cache_mem
> memory. . .
> Maybe someone will find it interesting to implement a useful memory
> cache in Squid someday, then using a larger cache_mem would for sure be
> beneficial in both memory hit rate and CPU usage.

The real problem here is the web cache's workload, not Squid. If you plotted
a graph of popularity of each object, with objects sorted from most to least
popular, you would see that the curve decreases relatively slowly, roughly
following what is known as a Zipf's Law curve. That has much slower dropoff
than the popularity of objects in more conventional caches such as processor
caches.

That, in turn, means that you have to hold vast gobs of objects in order to
achieve a reasonably high hit rate. In other words, to make a memory cache
worthwhile, you'd have to have almost as much memory space as Squid uses
on disk space.

And it would still be of limited effectiveness because few caches see *local*
hit rates above 45-50%, so the most you could hope for would be to save
every other disk access - maybe worth it if you have money to spend,
but not a spectacular speedup for the price.

Who knows? If you have that 1G in there already, and are willing to spend
most of it on Squid cache_mem, you might get a small speedup. It would make
an interesting experiment (anybody with gobs of memory, a spare PC or two,
and time to run Polygraph out there?).

-- 
Jon Kay        pushcache.com        jkay@pushcache.com
http://www.pushcache.com/           (512) 420-9025
Received on Sun Jul 11 1999 - 21:53:38 MDT

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