5 ms·
I love nginx, but one thing that I wish nginx could do is be able to enable/disable modules without having to recompile. It's annoying having to recompile nginx
by atambo 17y ago
I love nginx, but one thing that I wish nginx could do is be able to enable/disable modules without having to recompile. It's annoying having to recompile nginx whenever a new version of passenger is released.
- codexon 17y agoI agree with you there. Nginx should make it easier to automate this by having a link to the latest version like nginx.org/download/latest.tgz Fortunately, nginx allows you to upgrade to a new binary on the fly. http://wiki.nginx.org/NginxCommandLine#Upgrading_To_a_New_Binary_On_The_Fly http://wiki.nginx.org/NginxCommandLine#Upgrading_To_a_New_Bi...
- burke 17y agoHere's the script I've been using to install the latest version. It was kind of quickly hacked together, and the symlink stuff near the end breaks occasionally, so if anyone's going to use this, you might want to read it over first. http://gist.github.com/313430 http://gist.github.com/313430
- devicenull 17y agoIt's annoying, but I'd imagine there would be a performance penalty for having dynamically loadable modules. I'd rather keep the performance, and just have to recompile.
- cheald 17y agoI suspect that a lot of that is performance-oriented. By compiling modules into the binary, I suspect you can get far superior performance out of it than you could with hot-loaded modules.
- Daniel_Newby 17y agoCalling dynamically loaded libraries is very fast, no more than a few nanoseconds per message that passes between the server and a module. It is no worse than the dynamically-linked C standard library we use so heavily. Development effort is probably the real reason. It takes a fair amount of planning to design a table-driven module loader and indirection layer. Indirection with raw pointers costs brain power. (And do not even think about the reference counting hell of a dynamically unloadable module.) Edit: And think about what happens when you upgrade a Django or Rails plug-in: it generally gets recompiled and what amounts to relinked. The difference is that the language system itself hides the work, while nginx uses explicit build tools.
- deleted 17y ago[deleted]
- epochwolf 17y agoGiven that you can hot-swap the binary you could just write a bash script to enable or disable the modules you want and swap out the binary when it finishes compiling your changes.