Ngx_openresty mainline version released

Hello folks!

I am happy to announce that the new mainline version of ngx_openresty,, is now released:

Special thanks go to all the contributors for making this happen!

Below is the complete change log for this release, as compared to the
last (stable) release,

  • bundled the new LuaRestyWebSocketLibrary 0.01.

    • this Lua library implements both a nonblocking WebSocket
      server and a nonblocking WebSocket client based on
      LuaNginxModule’s cosocket API. thanks Hendrik Schumacher.
  • bundled the new LuaRestyLockLibrary 0.01.

    • this Lua library implements a simple nonblocking mutex lock
      API based on LuaNginxModule’s shared memory dictionaries.
      Mostly useful for eliminating “dog-pile effects” and etc.
      thanks Sri Rao for the suggestion.
  • upgraded LuaRestyRedisLibrary to 0.16.

    • feature: added new redis commands bitcount, bitop, client,
      dump, hincrbyfloat, incrbyfloat, migrate, pexpire,
      pexpireat, psetex, pubsub, pttl, restore, and time. thanks
      alex-yam for the patch.

    • optimize: eliminated the table.insert() calls because they
      are slower than “tb[#tb + 1] = val”. thanks alex-yam for the
      patch. this gives 1.9% speed up for trivial set and get
      examples when LuaJIT 2.0.2 is used and 4.9% speed up when
      LuaJIT’s v2.1 git branch is used.

    • refactor: avoided using Lua 5.1’s module() function for
      defining our Lua modules because it has bad side effects.

    • docs: do not use 0 (i.e., unlimited) max idle time in the
      set_keepalive() call in the code sample.

    • docs: added code samples for the redis commands “hmget” and
      “hmset”. this has already become a FAQ.

    • docs: added the Redis Authentication section because it is
      already an FAQ.

    • docs: documented the “options” table argument for the
      connect() method.

    • docs: added a missing “local” keyword to the code sample.
      thanks Wendal C. for the patch.

  • upgraded LuaRestyMemcachedLibrary to 0.12.

    • optimize: no longer use Lua tables and table.concat() to
      construct simple Memcached query strings. this gives 6.75%
      overall speed up for trivial “set” and “get” examples when
      LuaJIT 2.0.2 is used.

    • optimize: eliminated table.insert() because it is slower
      than “tb[#tb + 1] = val”.

    • refactor: avoided using Lua’s module() function for defining
      our Lua modules because it has bad side effects.

    • docs: use limited (10 sec) max idel timeout for in-pool
      connections in the code sample.

  • upgraded LuaNginxModule to 0.9.0.

    • feature: added support for raw downstream cosocket via the
      ngx.req.socket(true) API, upon which http upgrading
      protocols like WebSocket can be implemented with pure Lua
      (see LuaRestyWebSocketLibrary). This API can also be used to
      bypass the Nginx output filters and emit raw HTTP response
      headers and/or HTTP response bodies. thanks Hendrik
      Schumacher and aviramc.

    • bugfix: memory invalid reads might happen when
      ngx.flush(true) was used: the “ctx” struct could get freed
      in the middle of processing and we should save the state
      explicitly on the C stack.

    • bugfix: the standard Lua coroutine API was not available in
      the context of init_by_lua* and threw out the “no request
      found” error. thanks Wolf Tivy for the report.

    • bugfix: massive compatibility fixes for the Microsoft Visual
      C++ compiler. thanks Edwin Cleton for the report.

    • bugfix: Lua VM might run out of memory when “lua_code_cache”
      is off; now we always enforce a full Lua GC cycle right
      after unloading most of the loaded Lua modules when the Lua
      code cache is turned off.

    • change: raised the “lua_code_cache is off” warning to an

  • upgraded NginxDevelKit to 0.2.19.

    • bugfix: fixed warnings from the Microsoft Visual C++
      compiler. thanks Edwin Cleton for the report.

The HTML version of the change log with lots of helpful hyper-links
can be browsed here:

OpenResty (aka. ngx_openresty) is a full-fledged web application
server by bundling the standard Nginx core, lots of 3rd-party Nginx
modules and Lua libraries, as well as most of their external
dependencies. See OpenResty’s homepage for details:

We have run extensive testing on our Amazon EC2 test cluster and
ensured that all the components (including the Nginx core) play well
together. The latest test report can always be found here:

Have fun!

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs