RFC: Feasibility of a "dynamic module loader" built in to nginx?

Michael Shadle mike503 at gmail.com
Thu Aug 26 15:14:10 MSD 2010

It seems (at least to me) that the past year has seen explosive growth
in nginx usage and third party module development.

I believe that for package management, as well as module adoption, it
would be a definite move in the right direction to be able to load
modules up on demand instead of having to custom compile nginx with
the modules you want.

That allows for module development to be done completely independently
of nginx, modules to be added/removed, etc, without needing to
recompile nginx every time.

I find that the majority of people would most likely say this is a
good idea, a few may think it is not necessary, but everyone can
benefit, and for those who don't, they can still maintain their nginx
however they want, by recompiling each time.

I don't expect much overhead being added, as the modules would still
only be loaded when the master process (or perhaps child processes?)

Ideally it would be as simple as

load /usr/lib/nginx/mod_drizzle.so;

Or something in the configuration. This would allow plugins to
flourish without complex build instructions or having to touch the
nginx core; module developers could be informed to make version checks
and issue a notice when trying to startup, something along the lines
of "mod_drizzle is not compatible with this version of nginx (=>
0.8.43 needed)" or something of that nature.

I do not know if nginx could support this or not, it seems like it
should be able to, if it is able to accept modules at compile time,
just some more magic could be added to dynamically load something else

I'm sure some people would offer to help sponsor this if needed...

As usual, this is open for discussion, I'd really like to hear
Igor/Maxim's take, or what the FRiCKLE guys or agentzh would have to
say about how useful this would be or how easy they think it could be

Personally I have not played with many third party modules; I have
passenger being built as part of my build script but I only use it on
one machine, all the other ones issue an annoying notice (that I've
been trying to get removed) - but being able to just install a module
and then enable it quickly to play with it, that would allow me to try
out all these third party modules out there.

The future seems to be moving to ultimate modularity. Having to
recompile the core each time for a third party module seems archaic
still. This should allow for module developers to focus a lot more on
purely releasing updates to modules, and not instructions on compiling
core with them, etc.


More information about the nginx mailing list