Hi,
I stumbled upon this project recently, and didn't see any mention in the presentation or elsewhere about how this compares to the ngx_lua module and OpenResty. A comparison with Perl is made, but not with Lua, which I don't think has the same drawbacks.
Language differences aside, why should I use njs over ngx_lua?
Thanks, and apologies if this isn't the right place for this discussion.
Hi @imiric,
Language differences aside, why should I use njs over ngx_lua?
While OpenResty is mature and a great tool to use, we decided to implement our own scripting for nginx for several reason.
1) njs is tailored to be executed inside nginx (fast VM creation/destroying), lua may have GC issues under heavy load.
2) lua adds a lot of ad-hoc features (directives, lua methods), njs strives for simplicity using powerful native nginx primitives (variables, subrequests).
3) njs is a pure nginx module, OpenResty is a set of patches which sometime abuses original nginx design.
4) we need our own scripting for nginx-plus (paid version) features.
While we already use njs for production it is still in early phase and lacks many features which OpenResty has. BTW we do not plan to implement everything lua/openresty has because the design philosophy is different.
Most helpful comment
Hi @imiric,
While OpenResty is mature and a great tool to use, we decided to implement our own scripting for nginx for several reason.
1) njs is tailored to be executed inside nginx (fast VM creation/destroying), lua may have GC issues under heavy load.
2) lua adds a lot of ad-hoc features (directives, lua methods), njs strives for simplicity using powerful native nginx primitives (variables, subrequests).
3) njs is a pure nginx module, OpenResty is a set of patches which sometime abuses original nginx design.
4) we need our own scripting for nginx-plus (paid version) features.
While we already use njs for production it is still in early phase and lacks many features which OpenResty has. BTW we do not plan to implement everything lua/openresty has because the design philosophy is different.