varnish 2.1.5 memory and swap

Hettwer, Marian mhettwer at team.mobile.de
Tue May 24 11:39:54 CEST 2011


Reply to myself

Although varnishd runs with malloc 6G, it seems that it's using much more
memory:
 PID USER      PR  NI  VIRT  RES  SHR S %CPU COMMAND
                   
                   
         
21693 nobody    20   0 12.5g 7.2g  80m S    0 varnishd
                   
                   
           


Hu? Resistent at 7,2GB and Virtual at 12,5GB. Why?

./Marian



On 24.05.11 11:12, "Hettwer, Marian" <mhettwer at team.mobile.de> wrote:

>Hi List,
>
>I'm running varnish successfully in front of a high traffic website.
>However, once in a while (every few weeks), my Nagios notifies me that one
>of my varnish machines is about to run out of swap.
>
>
>I can't get around Linux and swap usage.
>So here is what I have:
>
>A varnishd with 6GB malloc.
>root at kvarnish46-1:~ # ps ax | grep varnish
>21692 ? Ss 1:07 /usr/sbin/varnishd -P /var/run/varnishd.pid -a :80 -f
>/etc/varnish/kvarnish.vcl -T 127.0.0.1:6082 -t 120 -h critbit -p
>thread_pools 4 -p thread_pool_min 100 -p thread_pool_max 5000 -p
>thread_pool_add_delay 2 -p session_linger 120 -p connect_timeout 4 -S
>/etc/varnish/secret -s malloc,6G
>21693 ? Sl 1709:15 /usr/sbin/varnishd -P /var/run/varnishd.pid -a :80 -f
>/etc/varnish/kvarnish.vcl -T 127.0.0.1:6082 -t 120 -h critbit -p
>thread_pools 4 -p thread_pool_min 100 -p thread_pool_max 5000 -p
>thread_pool_add_delay 2 -p session_linger 120 -p connect_timeout 4 -S
>/etc/varnish/secret -s malloc,6G
>27134 pts/0 S+ 0:00 grep --color=auto varnish
>
>
>
>On a machine with 8GB RAM and 1 GB swap.
>
>root at kvarnish46-1:~ # free
>             total       used       free     shared    buffers     cached
>Mem:       8194928    8007964     186964          0      99988     144468
>-/+ buffers/cache:    7763508     431420
>Swap:      1052636     950848     101788
>
>There is not running anything else. Apart from system cronjobs and sshd.
>
>The machine is exclusive for running varnish.
>
>Uname -a
>Linux kvarnish46-1 2.6.35-mobile.de.lenny #1 SMP Tue Aug 17 17:57:04 CEST
>2010 x86_64 GNU/Linux
>
>It's a Debian 5.0.8.
>
>Any hints or even better explanation what is going on here?
>I thought about chaning the vm.swapiness parameter. But I'm not sure
>whether this would do the trick. Or better: What it actually would change.
>
>My best theory is, that varnish is using virtual memory and that the
>memory management of linux is kinda stubbornly putting the pages into
>swap, because varnish hasn't ask for them quite a while.
>I really don't like my own theory... Yak!
>
>Any help appreciated and thanks in advance,
>Marian
>
>
>_______________________________________________
>varnish-misc mailing list
>varnish-misc at varnish-cache.org
>http://www.varnish-cache.org/lists/mailman/listinfo/varnish-misc





More information about the varnish-misc mailing list