How to accurately determine cache size

Matt Schurenko MSchurenko at
Fri Aug 12 19:31:00 CEST 2011

How does one accurately determine the used cache size of varnish? Can this information be gleaned from varnishstat? The closest thing I've found is "n_object" which is the amount of objects in the cache. Also, related to this, approximately how much overhead does varnish require? I am running varnishd (varnish-3.0.0 revision 3bd5997) with '-s malloc, 30g'. There is 32GB of RAM on this server and 15GB of swap. I was hoping that the cache would get full before the system ran out of physical memory and varnish would start to nuke objects rather than force the system to start using swap space. This didn't happen. Instead my swap usage went to ~14.5 GB. I started to get concerned as I watched nearly all of the swap space being consumed. I was expecting bad things to happen. Fortunately the TTL for many of the older objects expired around this same time so the memory usage started to go down. If I have 32 GB of RAM how big should I set malloc so that I don't start swapping?
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <>

More information about the varnish-misc mailing list