Varnish virtual memory usage

Kristian Lyngstol kristian at
Wed Oct 21 13:34:26 CEST 2009

On Mon, Sep 21, 2009 at 02:55:07PM +0300, Roi Avinoam wrote:
> At Metacafe we're testing the integration with Varnish, and I was tasked
> with benchmarking our Varnish setup. I intentionally over-flooded the
> server with requests, in an attempt to see how the system will behave
> under extensive traffic. Surprisingly, the server ran out of swap and
> crashed.

That seems mighty strange. What sort of tests did you do?

> In out configuration, "-s file,/var/lib/varnish/varnish_storage.bin,1G".
> Does it mean Varnish shouldn't use more than 1GB of the virtual memory?
> Is there any other way to limit the memory/storage usage?

If you are using -s file and you have 4GB of memory, you are telling
Varnish to create a _file_ of 1GB, and it's up to the kernel what it keeps
in memory or not. If you actually run out of memory with this setup, you've
either hit a bug (need more details first), or you're doing something
strange like having the mmaped file (/var/lib/varnish/) in tmpfs with a
sizelimit less than 1GB or something along those lines. But I need more
details to say anything for certain.

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: <>

More information about the varnish-misc mailing list