child process of varnishd restarts automatically

Traian Bratucu traian.bratucu at eea.europa.eu
Mon Dec 20 15:19:08 CET 2010


It is possible Varnish is trying to fetch a very large object (hundreds of Mb, maybe >1Gb) and it tries to store it in the cache, failing because of lack of memory.
At least that is what it looks like to me.

Traian

________________________________________

Hi All

We are running varnish on a 32-bit centos 5 box and we have noticed that sometimes the child process of varnishd will restart automatically.

/var/log/messages shows the following error message:

varnishd[12707]: Child (12708) died signal=6
varnishd[12707]: Child (12708) Panic message: Missing errorhandling code in sma_alloc(), storage_malloc.c line 81:   Condition((sma->s.ptr) != 0) not true.errno = 12 (Cannot allocate memory) thread = (cache-worker) ident = Linux,2.6.18-194.8.1.el5PAE,i686,-smalloc,-hcritbit,epoll Backtrace:   0x806cb6c: varnishd [0x806cb6c]   0x8088047: varnishd [0x8088047]   0x8085b3a: varnishd(STV_alloc+0xda) [0x8085b3a]   0x8063a91: varnishd(FetchBody+0x7c1) [0x8063a91]   0x8059f87: varnishd [0x8059f87]   0x805b93a: varnishd(CNT_Session+0x44a) [0x805b93a]   0x806f5ef: varnishd [0x806f5ef]   0x806e671: varnishd [0x806e671]   0x806eb6f: varnishd [0x806eb6f]   0xc65832: /lib/libpthread.so.0 [0xc65832] sp = 0xb7ec5004 {   fd = 15, id = 15, xid = 608646521,   client = 127.0.0.1:57125<http://127.0.0.1:57125>,   step = STP_FETCH,   handling = deliver,   err_code = 200, err_reason = (null),   restarts = 0, esis = 0   ws = 0xb7ec504c {      id = "sess",     {s,f,r,e} = {0xb7ec57dc,+956,(nil),+16384},   },   http[req] = {     ws = 0x
varnishd[12707]: child (32242) Started
varnishd[12707]: Child (32242) said
varnishd[12707]: Child (32242) said Child starts


Varnishd was started with option "malloc,1.5G" and it runs without any problem for hours before the child process restarts. When the child process restarts, the system still have about 1.5G free memory so this is not a out of memory issue.

Does anybody know how to solve this?

Thanks,

Vincent




More information about the varnish-misc mailing list