Varnish virtual memory usage

Kristian Lyngstol kristian at redpill-linpro.com
Wed Oct 21 15:27:59 CEST 2009


On Wed, Oct 21, 2009 at 03:07:00PM +0200, Roi Avinoam wrote:
> Thanks for your reply.
> 
> 1. What I did was create 100 simultaneous processes, and each process requested the same page (with 'curl'):
> 	a. Once with the exact same URL - which resulted in a 99.9% hit-ratio and VERY high performance on varnish.
> 	b. And once with a random key that changes the URL (something like 'index.php?rand=193837364'), thus forcing Varnish to hit the backend, and store the multiple objects in memory. 
> 	c. A combination of the two - in an attempt to maintain a 60-70% hit-ratio.
> 
> What we saw is that the kernel simply filled all of the RAM *and* the swap until it crashed. 

When did it fill up and how fast?

> 2. I'm sorry, but I'm still confused about the mmaped file. If it's
> limited to 1G, Varnish shouldn't use more than 1G of virtual memory,
> correct? Or in our setup - 1G of RAM?

The -s parameter only applies to storage, which is to say that it's an
approximiation and there will be some additional overhead which is not
stored there, ie datastructures for threads, sessions, backends etc.

So with -s ..., 1G, you should expect a little bit over 1GB, but not nearly
as much as you describe.

-- 
Kristian Lyngstøl
Redpill Linpro AS
Tlf: +47 21544179
Mob: +47 99014497
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 835 bytes
Desc: not available
URL: <https://www.varnish-cache.org/lists/pipermail/varnish-misc/attachments/20091021/aee89135/attachment-0003.pgp>


More information about the varnish-misc mailing list