[ANN] OpenResty released

Yichun Zhang (agentzh) agentzh at gmail.com
Fri Nov 18 01:20:04 UTC 2016

Hi folks,

I am excited to announce the new formal release,, of the
OpenResty web platform based on NGINX and LuaJIT:


Both the (portable) source code distribution and the Win32 binary
distribution are provided on this Download page.

We have many highlights in this release:

1. Includes new package management tool, opm, for community
contributed OpenResty packages (only Lua libraries for now, may add
support for dynamic nginx C modules in the future as well). See below
for more details on opm:



We maintain our own central package server at opm.openresty.org. As of
this writing, we already have 110 successful uploads across 74
distinct package names from 26 contributors. Come on, OPM authors!

The users of our official Linux packages should install the
openresty-opm package like this:

    yum install openresty-opm


    dnf install openresty-opm

2. The memory footprint of nginx worker processes is now much smaller
(as compared to the previous few OpenResty releases) after traffic
peak (via the new lua_malloc_trim directive of ngx_http_lua_module).


3. Includes new Lua library lua-resty-limit-traffic, which is the
Lua-land equivalent of nginx's ngx_limit_conn and ngx_limit_req
modules, but much more flexible and can be used in any request or
timer contexts that can yield. See below for more details:


4. Cosockets can now set different timeout threshold values for
connect, send, and read at the same time:


5. New split() API function that supports Perl-compatible regexes in
the new ngx.re Lua module.


6. Now it is supported for 3rd-party NGINX C modules to implement
their own shm-based storage and expose Lua API to the Lua land of
OpenResty. See


7. The Lua 5.2 language feature extension of LuaJIT 2.1 is now enabled
by default:


The complete change log since the last (formal) release,

 *   feature: added new command-line utility, opm of version 0.02,
     for managing community contributed OpenResty packages.

 *   change: now we enable "-DLUAJIT_ENABLE_LUA52COMPAT" in our
     bundled LuaJIT build by default, which can be disabled by
     "./configure --without-luajit-lua52". note that this change may
     introduce some minor backeward incompatibilities on the Lua
     land, see http://luajit.org/extensions.html#lua52 for more

 *   win32: upgraded OpenSSL to 1.0.2j.

 *   win32: enabled http v2, http addition, http gzip static, http
     sub, and several other standard nginx modules by default.

 *   updated the help text of "./configure --help" to sync with the
     new nginx 1.11.2 core.

 *   "make install": now we also create directories
     "<prefix>/site/pod/" and "<prefix>/site/manifest/".

 *   doc: updated README-win32.md to reflect recent changes.

 *   added new component, lua-resty-limit-traffic, which is enabled
     by default and can be explicitly disabled via the
     "--without-lua_resty_limit_traffic" option of the "./configure"
     script during build.

 *   upgraded ngx_lua to 0.10.7.

     *   feature: added a new API function
         "tcpsock:settimeouts(connect_timeout, send_timeout,
         read_timeout)". thanks Dejiang Zhu for the patch.

     *   feature: added public C API for 3rd-party NGINX C modules to
         register their own shm-based data structures for the Lua
         land usage (that is, to create custom siblings to
         lua_shared_dict). thanks helloyi and Dejiang Zhu for the

     *   feature, bugfix: added new config directive "lua_malloc_trim
         N" to periodically call malloc_trim(1) every "N" requests
         when "malloc_trim()" is available. by default,
         "lua_malloc_trim 1000" is configured. this should fix the
         glibc oddity of holding too much freed memory when it fails
         to use "brk()" to allocate memory in the data segment.
         thanks Shuxin Yang for the proposal.

     *   bugfix: segmentation faults might happen when ngx.exec() was
         fed with unsafe URIs. thanks Jayce LiuChuan for the patch.

     *   bugfix: ngx.req.set_header(): skips setting multi-value
         headers for bad requests to avoid segfaults. thanks Emil
         Stolarsky for the patch.

     *   change: ssl_session_fetch_by_lua* and
         ssl_session_store_by_lua* are now only allowed in the "http
         {}" context. use of these session hooks in the "server {}"
         scope did not make much sense since server name dispatch
         happens *after* ssl session resumption anyway. thanks
         Dejiang Zhu for the patch.

     *   optimize: optimized the lua_shared_dict node struct memory
         layout which can save 8 bytes for every key-value pair on
         64-bit systems, for example.

     *   doc: log level constants are also available in init_by_lua*
         and init_worker_by_lua* contexts. thanks kraml for the
         report and detailyang for the patch.

     *   doc: documented the support of 307 status argument value in

     *   doc: use "*_by_lua_block {}" in all the configuration
         examples. thanks pj.vegan for the patch.

     *   doc: documented how to easily test the
         ssl_session_fetch_by_lua* and ssl_session_store_by_lua*
         locally with a modern web browser.

 *   upgraded lua-resty-core to 0.1.9.

     *   feature: implemented the split() method in the ngx.re

     *   optimize: resty.core.shdict: removed one unused top-level
         Lua variable.

 *   upgraded ngx_headers_more to 0.32.

     *   bugfix: more_set_input_headers: skips setting multi-value
         headers for bad requests to avoid segfaults.

 *   upgraded lua-resty-redis to 0.26.

     *   optimize: hmset: use "select" to avoid creating temporary
         Lua tables and to be more friendly to LuaJIT's JIT compiler.
         thanks spacewander for the patch.

 *   upgraded lua-resty-dns to 0.18.

     *   optimize: removed unused local Lua variables. thanks Thijs
         Schreijer for the patch.

     *   change: stops seeding the random generator. This is user's
         responsibility now. thanks Thijs Schreijer for the patch.

 *   upgraded lua-resty-mysql to 0.17.

     *   bugfix: fixed the Lua exception "attempt to perform
         arithmetic on local len (a boolean value)". thanks Dmitry
         Kuzmin for the report.

     *   doc: renamed the "errno" return value to "errcode" for
         consistency. thanks Soojin Nam for the patch.

 *   upgraded lua-resty-websocket to 0.06.

     *   optimize: minor code optimizations and cleanups from Aapo

     *   doc: fixed copy&paste mistakes found by rock59.

 *   upgraded lua-resty-upload to 0.10.

     *   feature: the "new()" method now accepts an optional 2nd arg
         to configure the max line size.

     *   optimize: use the $http_content_type nginx built-in variable
         instead of "ngx.req.get_headers()["content-type"]". thanks
         Soojin Nam for the patch.

     *   optimize: minor optimization from Will Bond.

     *   optimize: various minor optimizations and cleanups from
         Soojin Nam, Will Bond, Aapo Talvensaari, and hamza.

 *   upgraded resty-cli to 0.16.

     *   feature: resty: forwarded more UNIX signals. thanks
         Zekai.Zheng for the patch.

     *   feature: restydoc: added new option "-r DIR" for specifying
         a custom root directory.

     *   feature: restydoc: added support for comment syntax, "#
         ...", in the "resty.index" file.

     *   bugfix: resty: literal single quotes led to nginx
         configuration errors in -e option values. thanks spacewander
         for the report.

     *   bugfix: restydoc-index: we did not ignore POD files in the
         output directory if they are also inside the input

     *   bugfix: restydoc-index: we should only ignore "pod"
         directories in the output directory, not the whole output

     *   bugfix: restydoc-index: we swallowed the section name right
         after the "Table of Contents" section (if any).

 *   upgraded LuaJIT to v2.1-20161104:

     *   imported Mike Pall's latest changes:

         *   LJ_GC64: Fix HREF for pointers.

         *   LJ_FR2: Fix slot 1 handling.

         *   Fix GC step size calculation.

         *   LJ_GC64: Fix "jit.on/off".

         *   Fix "-jp=a" mode for builtins.

         *   ARM: Fix BLX encoding for Thumb interworking calls.

         *   Initialize uv->immutable for upvalues of loaded chunks.

         *   Windows/x86: Add MSVC flags for debug build with
             exception interop.

         *   Fix exit status for "luajit -b".

         *   Must preserve "J->fold.ins" (fins) around call to

         *   Emit bytecode in .c/.h files with unsigned char type.

         *   Set arg table before evaluating "LUA_INIT" and "-e"

         *   Fix for cdata vs. non-cdata arithmetics/comparisons.

         *   Fix unused vars etc. in internal Lua files.

         *   Properly clean up state before restart of trace

         *   Drop leftover regs in 'for' iterator assignment, too.

         *   MIPS: Support MIPS16 interlinking.

         *   x64/LJ_GC64: Fix code generation for IR_KNULL call

         *   Fix PHI remarking in SINK pass.

         *   LJ_GC64: Set correct nil value when clearing a cdata

         *   LJ_GC64: Ensure all IR slot fields are initialized.

         *   LJ_GC64: Allow optional use of the system memory

         *   Fix Valgrind suppressions.

         *   Don't try to record outermost "pcall()" return to lower

         *   MIPS: Fix build failures and warnings.

         *   Proper fix for LJ_GC64 changes to "asm_href()".

         *   MIPS64, part 1: Add MIPS64 support to interpreter.

         *   DynASM/MIPS: Add missing MIPS64 instructions.

         *   x64/LJ_GC64: Fix "__call" metamethod for tailcall.

         *   Fix collateral damage from LJ_GC64 changes to

         *   Use MAP_TRYFIXED for the probing memory allocator, if

         *   x86: Don't spill an explicit REF_BASE in the IR.

         *   x64/LJ_GC64: Add missing backend support and enable JIT

         *   LJ_FR2: Add support for trace recording and snapshots.

         *   Embed 64 bit constants directly in the IR, using two

         *   Simplify GCtrace * reference embedding for trace

         *   Make the IR immovable after assembly.

         *   Add guard for obscure aliasing between open upvalues and
             SSA slots.

         *   Workaround for MinGW headers lacking some exception

         *   Remove assumption that lj_math_random_step() doesn't
             clobber FPRs.

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


OpenResty is a full-fledged web platform
by bundling the standard Nginx core, Lua/LuaJIT, 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:



More information about the nginx mailing list