Varnish is restarting frequently

Sparsh Gupta sparshgupta at gmail.com
Wed May 9 14:40:41 CEST 2012


Sorry for not including information on my swap before:

On 9 May 2012 02:11, emilio brambilla <emilio at antispam.it> wrote:

> hello,
>
>
> On 2012/05/08 8:02 PM, Sparsh Gupta wrote:
>
>> I have a bunch of Varnish servers (Exactly same configurations, caching
>> different keys on Intel 2650 series Computer + 16GB RAM + 32GB SSD each). I
>> am enclosing my configurations and settings along with my current
>> varnishstats.
>>
>> I am looking for more debug information and how to find the route cause
>> of my varnish getting restarting every 6-8 hours (all varnish servers)
>>
>> VARNISH_STORAGE_SIZE=32G
>> VARNISH_STORAGE_MALLOC="**malloc"
>>
> if you have 16 Gb of phisical ram you should not malloc 32 Gb, but
> something less than 16 Gb (usually 20% less than the phisical)
>
>
Each box is configured with 24GB of swap. they have 16GB physical making
them 40GB of available memory. I am using only 80% of it in Varnish as
adviced.


> how many swap did you set on these boxes? maybe the varnish is restarting
> because the kernel cannot allocate the ram it want.
>

It seems Kernel is indeed killing the varnish daemon due to no memory
available.

May  9 12:27:51 localhost kernel: [168419.861130] Node 0 DMA: 2*4kB 1*8kB
1*16kB 2*32kB 2*64kB 2*128kB 0*256kB 0*512kB 1*1024kB 1*2048kB 3*4096kB =
15840kB
May  9 12:27:51 localhost kernel: [168419.926467] Node 0 DMA32: 119*4kB
218*8kB 62*16kB 19*32kB 5*64kB 5*128kB 2*256kB 2*512kB 1*1024kB 3*2048kB
3*4096kB = 25772kB
May  9 12:27:51 localhost kernel: [168419.995910] Node 0 Normal: 910*4kB
0*8kB 0*16kB 0*32kB 0*64kB 1*128kB 0*256kB 0*512kB 1*1024kB 0*2048kB
0*4096kB = 4792kB
May  9 12:27:51 localhost kernel: [168420.063296] Node 1 Normal: 494*4kB
0*8kB 3*16kB 0*32kB 1*64kB 5*128kB 0*256kB 1*512kB 0*1024kB 0*2048kB
1*4096kB = 7336kB
May  9 12:27:51 localhost kernel: [168420.130742] 35438 total pagecache
pages
May  9 12:27:51 localhost kernel: [168420.154201] 32999 pages in swap cache
May  9 12:27:51 localhost kernel: [168420.176624] Swap cache stats: add
31746386, delete 31713387, find 4761486/8157803
May  9 12:27:51 localhost kernel: [168420.221926] Free swap  = 0kB
May  9 12:27:51 localhost kernel: [168420.239681] Total swap = 25999352kB
May  9 12:27:51 localhost kernel: [168420.328578] 4194288 pages RAM
May  9 12:27:51 localhost kernel: [168420.346865] 83407 pages reserved
May  9 12:27:51 localhost kernel: [168420.366696] 9039 pages shared
May  9 12:27:51 localhost kernel: [168420.385006] 4091500 pages non-shared
May  9 12:27:51 localhost kernel: [168420.406909] Out of memory: kill
process 2984 (varnishd) score 103268864 or a child
May  9 12:27:51 localhost kernel: [168420.452754] Killed process 2985
(varnishd)


I am unable to figure out a lot of sense out of these numbers and will
appreciate any help in fine tuning my varnish instance. I can try with 30G
or 28G but what is an idea number if we can conclude something based on
this info I found in my syslog

>
> if you want to use more than space you may use 'file' instead of 'malloc'
> (but I don't know if it's a good idea to use SSD for the cache.... how many
> rewrite does your ssd allow?)
>
>
Before buying the boxes, I read that fast SSDs are good enough for Varnish.
I got fast read write SSDs available these days on the servers



> --
> bye,
> emilio
>
>
Thanks
Sparsh

> ______________________________**_________________
> varnish-misc mailing list
> varnish-misc at varnish-cache.org
> https://www.varnish-cache.org/**lists/mailman/listinfo/**varnish-misc<https://www.varnish-cache.org/lists/mailman/listinfo/varnish-misc>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://www.varnish-cache.org/lists/pipermail/varnish-misc/attachments/20120509/44b4c6cf/attachment.html>


More information about the varnish-misc mailing list