Varnish cache storage

varnish

I'm trying to (re)build a VM that will be running Varnish Cache. One of the issues that I've had in the past, is running out of space (allocated space was ~10G).

I guess what I'm really confused about is how Varnish uses space. As soon as I start varnish it creates a file which is (from what I assume) is equivalent to size of your memory (which is in my case 4G) yet later on varnish end up using more space…

So what I'm trying to understand is how properly I should allocate space. Maybe some advises, best practices in general.

Best Answer

AFAIK there was a memory leak in version 3.0.0: are you perhaps hitting it?

Rather than using a ramdisk, I would simply change the varnishd option to "malloc", for example (change the size to something more useful, of course...)

  -s malloc,1G

BTW, even if the VM is dedicated to varnish, I would not allocate more than 80% of the RAM to the cache.

Related Topic