Re: How cache into RAM memory rather than on disk?

From: Jens-S. Voeckler <voeckler@dont-contact.us>
Date: Tue, 16 May 2000 15:32:13 +0200

Flavio Pescuma wrote:

> I think you haven't yet answer his question,
> How to make squid use the spare memory?
>
> My guess is that if you create a ram disk make a fs on it and mount it
> and then tell squid to use this cache drive as well then you will use
> your spare memory and get the benefit from RAM speed compared to disk,
> but of course this will only be for the objects stored on the RAM disk
> which probably are a small percentage compared to the ones stored in
> disk.

If you are using Unix, and you didn't do anything special, Squid
relies on your OS buffer cache to do a little actual caching for you.
Any good OS uses the amount of supposedly free RAM to cache files, etc.
Making use of the supposedly free RAM might result in a degredation
of performance. For instance, I have 2 GB RAM, and my Squid eats ~600MB
of it. I let the OS have the rest to do some file caching for Squid,
and indeed, free memory goes down to 64MB. And don't forget about the
TCP socket buffers: 64 K per socket buffer, and 1024 connections needs
128 MB (=recv+xmit) of RAM for socket buffers.

But back to the topic, using a RAM disk should still reserve RAM for
the buffer cache purposes. That is, I might come to think, unless
your OS has means to let you bypass buffer caching. And: Using a RAM
disk will still need to go all the way through the FS drivers and
friends.

Mr. Ivarsson might have some interesting results of Squid being
used in conjunction with a solid state disk (essentially RAM with
an SCSI interface).

> Henrik Nordstrom wrote:
> >
> > hillel@learn.co.za wrote:
> >
> > > Anyone know how to place the cache in RAM memory, rather than on the
> > > harddrive.
> > > When you view access.log, you get many TCP_HIT's and TCP_MEM_HIT's.
> > > TCP_HIT's are when a valid copy of the requested object was in the cache.
> > > and TCP_MEM_HIT's are when the requested object was in cache and memory,
> > > thus avoiding disk access. How do you get squid to put the cached objects
> > > in memory if there is space? This should speed up the cache considerably.
> >
> > Squid currently can't do that. It did once in a time (the Squid-1.1
> > series) but was changed to the current behaviour because of other memory
> > usage performance problems (it was a bit to keen on using memory).
> >
> > Squid will quite likely be changed to again cache TCP_HIT's in memory
> > some time, but I cannot give you a date when this will happen. Hopefully
> > sometime this year.
> >
> > --
> > Henrik Nordstrom
> > Squid hacker
>
> --
> WIRE - Web & Internet Resources at Ericsson
> Flavio Pescuma phone: +46 (0)8 7263359
> L M Ericsson Data AB fax: +46 (0)8 7217207
> 125 82 Stockholm Sweden http://eriweb.ericsson.se

-- 
Le deagh dhùrachd,
Dipl.-Ing. Jens-S. Vöckler (voeckler@rvs.uni-hannover.de)
Institute for Computer Networks and Distributed Systems
University of Hanover, Germany; +49 511 762 4726
Received on Tue May 16 2000 - 07:41:25 MDT

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