communication between worker processes

Leo P. junk at
Fri Oct 23 01:28:39 MSD 2009

FYI, and for anyone else encountering this problem, I ended up rolling 
my own socketpairs and reusing some of the existing channel handling 
functions. One caveat that I did notice:
 - The number of worker processes is needed before nginx fork()s. You 
can get this in your module's __initialization handler__ from
((ngx_core_conf_t *) ngx_get_conf(cycle->conf_ctx, 
In any other module handler it will either be too early or too late to 
access this data.

 - Leo

Maxim Dounin wrote:
> Hello!
> On Mon, Oct 19, 2009 at 05:18:12PM -0400, Leo P. wrote:
> [...]
> Socket pairs in question are used for nginx's own needs (control 
> commands from master to workers).  Any attempt to reuse them will 
> case nginx malfunction at next control command.
> Eventually this will grow into something more generic and modules 
> will be able to use this for their own commands.  But it's not here 
> yet.
> Maxim Dounin
> p.s. BTW, just to make sure you know: nginx_http_push_module 
> relies on shared memory as something unconditionally available for 
> all processes, but this isn't really true during binary upgrades.  
> New binary creates their own shared memory zones from scratch.  As 
> a result - module won't survive binary upgrades flawlessly but 
> will loose messages instead.

More information about the nginx mailing list