Varnish Memory Consumption

Tollef Fog Heen tfheen at linpro.no
Thu Sep 11 11:29:16 CEST 2008


]] Chaim Keren Tzion 

| I'm running Varnish -r2626 on CentOS 5.2
| 
| The problem I'm having is that Varnish eats up all 16GB of RAM that I
| have and then fills up the 2GB Swap space. Also, one of the three
| Varnish machines I have is a Virtual Machine (8GB RAM +2GB Swap). The
| VM panics some time after the Swap fills up and becomes
| unresponsive. The hardware machines keep on running.
| 
| My questions are:
| 
| Regarding the memory consumption:
| Is this normal?

Yes, fairly normal, given that you've given Varnish ~91G to use.  Apart
from the crashing, that is.  It shouldn't crash the virtual machine (but
then, that's a bug in your kernel rather than Varnish).

| Do I need to enlarge my Swap?

swap shouldn't really matter with mmap.

| Do I have to define a storage file that is less than the RAM+Swap that
| I can give to Varnish, in order to ensure that they don't get filled
| up? Should I switch to malloc? Will an upgrade to a newer revision
| help?

I'd recommend trying a swap partition the same size as the backing file
you use today and going with malloc and see if the problem then goes
away.

| Regarding the Virtual Machine:
| Is there a way to protect the Virtual Machine?
| It it a bad idea to use a Virtual Machine?

Which virtualisation environment are you using?

-- 
Tollef Fog Heen 
Redpill Linpro -- Changing the game!
t: +47 21 54 41 73



More information about the varnish-misc mailing list