FRiCKLE Labs & MegiTeam pres. ngx_supervisord

I’m proud to present a module, already mentioned on the list a few days
by Grzegorz N., that provides nginx with API to communicate with

Initial release adds the ability to START and STOP backends (or any
programs) on demand. If supervisord’s [program:backend0] entry is
with “startsecs” parameter, then supervisord (and ngx_supervisord) will
that time before returning successful or failed status. This is of
done in asynchronous way, so it doesn’t halt nginx for a moment.

This simple feature, combined with load-aware load balancers (like
Nosek’s nginx-upstream-fair) can offer very powerful features (starting
first backend when the first request arrives, starting/stopping backends
demand, depending on the load, etc, etc). Patch for nginx-upstream-fair
included in the release and it shows how easy all of this can be

Current version allows only one module to “register” its monitors with
ngx_supervisord, but as soon as there will be need for more (read: other
modules will start using ngx_supervisord), this will be changed without
changes in the API.

If something is unclear, just ask.

This module was fully funded by

For more information, API specification & download please visit:

Best regards,
Piotr S. < [email protected] >

This is exciting. Thanks for contributing it.


2009/10/28 Piotr S. [email protected]

Version 1.1 is available at:

2009-11-16 VERSION 1.1
* Add “supervisord_name” directive (which overrides
upstream{}'s name when communicating with supervisord).

* Allow module to compile with nginx-0.7.63+ and 0.8.7+.

Best regards,
Piotr S. < [email protected] >

Version 1.4 is now available at:

2010-04-29 VERSION 1.4
* Send shutdown command to supervisord on backend failure
and try to bring back first backend after all backends fail.
This is default and non-configurable behavior.
Requested by Grzegorz N…

Best regards,
Piotr S. < [email protected] >

Version 1.2 is now available at:

2009-11-19 VERSION 1.2
* Don’t run “monitors” on “cache manager” and “cache loader”
processes (this could lead to crash of either of them
when ngx_supervisord-enable load balancer tried to access
data available only on “worker” processes).

  NOTE: This modification uses undocumented nginx's "feature"
  to distinguish mentioned processes and starting from this
  release "worker_connections" cannot be set to 512 (it can be
  set to either lower or higher number, just not equal to 512).

Best regards,
Piotr S. < [email protected] >