child process of varnishd restarts automatically

Vincent cooltechemail at gmail.com
Tue Dec 21 23:03:17 CET 2010


Hi Kristian,

Thank you for your reply.

I think the problem is when varnish uses more than 4GB virtual memory on
32-bit, it will restart. I started varnish with  "-s malloc,1.5G". Varnish
will gradually increase memory usage and stop at about 1.7G. However, the
virtual memory size is growing continuously and it doesn't seem to stop. We
restarted varnish yesterday and currently the VM size is 2.7G, and it is
still growing. Is this normal?

Yes, I know we should have used 32-bit in the first place. The reason is
that we have some other applications work on 32-bit only. Anyway, we will
build a 64-bit box dedicated for Varnish. However, isn't it nice to have
varnish run without any problems on 32-bit machines?

Thank you again.

Vincent

On Mon, Dec 20, 2010 at 6:22 AM, Kristian Lyngstol <
kristian at varnish-software.com> wrote:

> Hi,
>
> On Mon, Dec 20, 2010 at 06:04:53AM -0800, Vincent wrote:
> > 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.
>
> You should be using 64bit.
>
> > 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 =
>
> (...)
>
> > 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.
>
> You are out of memory - possibly 32-bit-related issue since you have a
> artificially limited address space.
>
> That your system has 1.5GB "free" memory doesn't mean you can use it.
> That's why you want to run 64-bit systems: then you can actually use the
> memory too. An other possible culprit is disabling overcommit - but if you
> actually had free memory, it's unlikely that that's your problem.
>
> The proper solution to this problem is to reinstall your system using a
> 64-bit operating system. If you prefer wasting countless hours, you can try
> to estimate the overhead of the object count (roughly 1kB) and how that
> affects the total memory usage of varnishd, factor in stack size of
> threads, constant memory overhead and the available address space left to
> you - it's seriously not fun (or all that easy).
>
> - Kristian
>
> -----BEGIN PGP SIGNATURE-----
> Version: GnuPG v1.4.10 (GNU/Linux)
>
> iQEcBAEBAgAGBQJND2aYAAoJEIC1IG5rXEfqVFgH/0TeE1wpicXP8Y4ze4EYTNBp
> 6/H+XFWs4YOukZkPING4r61oa5KPc0zDAjgsfrlbeY1f3stQtIXRXJ3zAI+i3XTp
> zHELLKw91deQGOWBepvjojaUZxBEg6gcwIKMP1gSK17HI6T5OyLoxlunr0rvvbRd
> Yonmqj5EOAXpZSMBsf8Qe31spybhEcwvG6LYsu/Oho7SxBk7aU7RcvvqbF2EW6OJ
> Z60IrJK94qLYkY7dFT5/BguPp2G3CaEL6Ok3P6j8WSvWA/d4i0VXHnWeosG+dvoh
> W3b8g+4ACeqJSI7uxepR0M2gFD6y2Ait4+VeV14JAWUkqyOZ2s7c92fANou6Jf4=
> =7I7m
> -----END PGP SIGNATURE-----
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://www.varnish-cache.org/lists/pipermail/varnish-misc/attachments/20101221/972ccc42/attachment-0003.html>


More information about the varnish-misc mailing list