child process of varnishd restarts automatically

Kristian Lyngstol kristian at varnish-software.com
Mon Dec 20 15:22:18 CET 2010


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
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 490 bytes
Desc: Digital signature
URL: <https://www.varnish-cache.org/lists/pipermail/varnish-misc/attachments/20101220/d2434d9b/attachment-0003.pgp>


More information about the varnish-misc mailing list