OpenResty 1.4.3.1 发布,Web 应用服务器

oschina
 oschina
发布于 2013年10月30日
收藏 13

OpenResty 1.4.3.1 发布,OpenResty (也称为 ngx_openresty)是一个全功能的 Web 应用服务器。它打包了标准的 Nginx 核心,很多的常用的第三方模块,以及它们的大多数依赖项。

这是一个维护版本,完整的改进记录包括:

  • upgraded the Nginx core to 1.4.3.
  • upgraded LuaNginxModule to 0.9.1.
    • feature: added the new configuration directive "lua_use_default_type" for controlling whether to send out a default Content-Type response header (as defined by the default_type directive). default on. thanks aviramc for the patch.
    • feature: now the raw request cosocket returned by ngx.req.socket(true) no longer requires the request body to be read already, which means that one can use this cosocket to read the raw request body data as well. thanks aviramc for the original patch.
    • bugfix: when there were no existing Cache-Control response headers, ngx.header.cache_control = nil would (incorrectly) create a new Cache-Control header with an empty value. thanks jinglong for the patch.
    • bugfix: the original letter-case of the header name was lost when creating the Cache-Control response header via the ngx.header.HEADER API.
    • bugfix: ngx.req.set_header("Host", value) would overwrite the value of $host with bad values. thanks aviramc for the patch.
    • bugfix: use of ngx.exit() to abort pending subrequests in other "light threads" might lead to segfault or request hang when HTTP 1.0 full buffering is in effect.
    • bugfix: removing a request header might lead to memory corruptions. thanks Bjørnar Ness for the report.
    • bugfix: reading ngx.status might get different values than $status. thanks Kevin Burke for the report.
    • bugfix: downstream write events might interfere with upstream cosockets that are slow to write to. thanks Aviram Cohen for the report.
    • bugfix: the bookkeeping state for already-freed user threads might be incorrectly used by newly-created threads that were completely different, which could lead to bad results. thanks Sam Lawrence for the report.
    • bugfix: calling ngx.thread.wait() on a user thread object that is already waited (i.e., already dead) would hang forever. thanks Sam Lawrence for the report.
    • bugfix: the alert "zero size buf" could be logged when assigning an empty Lua string ("") to ngx.arg[1] in body_filter_by_lua*.
    • bugfix: subrequests initiated by ngx.location.capture* could trigger unnecessary response header sending actions in the subrequest because our capturing output header filter did not set r->header_sent.
    • bugfix: the Lua error message for the case that ngx.sleep() was used in log_by_lua* was not friendly. thanks Jiale Zhi for the report.
    • bugfix: now ngx.req.socket(true) returns proper error when there is some other "light thread" reading the request body.
    • bugfix: header_filter_by_lua*, body_filter_by_lua*, and ngx.location.capture* might not work properly with multiple "http {}" blocks in nginx.conf. thanks flygoast for the report.
    • optimize: made ngx.re.match and ngx.re.gmatch faster for LuaJIT 2.x when there is no submatch captures.
    • optimize: pre-allocate space for the Lua tables in various places.
    • doc: fixed the context for the lua_package_path and lua_package_cpath directives. thanks duhoobo for the report.
  • upgraded HeadersMoreNginxModule to 0.23.
    • bugfix: removing request headers via more_clear_input_headers might lead to memory corruptions.
    • bugfix: more_set_input_headers might overwrite the value of the $host variable with bad values.
    • bugfix: more_set_headers and more_clear_headers might not work when multiple "http {}" blocks were used in nginx.conf.
    • bugfix: eliminated use of C global variables during configuration phase because it might lead to issues when HUP reload failed.
  • upgraded SrcacheNginxModule to 0.23.
    • bugfix: this module might not work properly with multiple "http {}" blocks in nginx.conf.
    • bugfix: we might (incorrectly) return 500 in our output filters.
    • bugfix: we did not set r->header_sent when we want to discard the header in our header filter.
  • upgraded RdsJsonNginxModule to 0.12.
    • bugfix: in case of multiple "http {}" blocks in nginx.conf, our output filters might be disabled even when this module is configured properly.
    • bugix: we did not check the NULL pointer returned by an Nginx array element allocation.
  • upgraded RdsCsvNginxModule to 0.05.
    • optimize: we now only register our output filters when this module is indeed used (the only exception is when multiple "http {}" blocks are used).
  • upgraded XssNginxModule to 0.04.
    • optimize: we now only register our output filters when this module is indeed used (the only exception is when multiple "http {}" blocks are used).
  • upgraded EchoNginxModule to 0.49.
  • upgraded LuaRestyRedisLibrary to 0.17.
  • upgraded LuaRestyUploadLibrary to 0.09.
    • bugfix: removed use of the module() function to prevent bad side-effects.
    • optimize: Removed use of lua tables and table.concat() for simple one-line Lua string concatenations.
  • upgraded LuaRestyMySQLLibrary to 0.14.
    • bugfix: avoided using Lua 5.1's module() function for defining our Lua modules because it has bad side effects.
    • optimize: added an optional new argument "nrows" to the query() and read_result() methods, which can speed up things a bit.
    • optimize: use LuaJIT v2.1's new table.new() API to optimize Lua table allocations. when table.new is missing, just fall back to the good old "{}" constructor. this gives 12% overall speed-up for a typical result set with 500 rows when LuaJIT 2.1 is used.
    • optimize: eliminated use of table.insert() because it is slower than "tb[#tb + 1] = val".
    • optimize: switched over to the multi-argument form of string.char().
    • optimize: no longer use Lua tables and table.concat() to construct simple query strings.
  • upgraded LuaRestyWebSocketLibrary to 0.02.
    • optimize: use LuaJIT 2.1's table.new() to preallocate space for Lua tables, eliminating the overhead of Lua table rehash.
  • feature: applied the proxy_host_port_vars patch to the Nginx core to make $proxy_host and $proxy_port accessible for dynamic languages like Lua and Perl.
  • bugfix: applied the gzip_flush_bug patch to the Nginx core to fix request hang caused by the ngx_gzip and ngx_gunzip modules when using ngx.flush(true), for example. Thanks Maxim Dounin for the review.
  • bugfix: applied the cache_lock_hang_in_subreq patch to the Nginx core to fix the request hang when using proxy_cache_lock in subrequests and the cache lock timeout happens.
  • bugfix: backported Maxim Dounin's patch to fix an issue in the ngx_gzip module: it did not clear r->connection->buffered when the pending data was already flushed out. this could hang LuaNginxModule's ngx.flush(true) call, for example.

See ChangeLog1004002 for change log for OpenResty 1.4.2.x.

本站文章除注明转载外,均为本站原创或编译。欢迎任何形式的转载,但请务必注明出处,尊重他人劳动共创开源社区。
转载请注明:文章转载自 OSCHINA 社区 [http://www.oschina.net]
本文标题:OpenResty 1.4.3.1 发布,Web 应用服务器
加载中

最新评论(8

haitaosoft
haitaosoft
好像没有 mssql 的驱动?
zzjin
zzjin
感谢LS这么全的教程资料~
eechen
eechen

引用来自“eechen”的评论

淘宝量子统计(数据接口层/网络中间层)使用了Nginx/Lua:
http://developer.51cto.com/art/201207/350070.htm
API管理解决方案提供商3scale就使用了openresty:
curl -I http://www.3scale.net/xmlrpc.php

http://tech.3scale.net/2013/01/09/augment-your-api-without-touching-it/
eechen
eechen
淘宝量子统计(数据接口层/网络中间层)使用了Nginx/Lua:
http://developer.51cto.com/art/201207/350070.htm
API管理解决方案提供商3scale就使用了openresty:
curl -I http://www.3scale.net/xmlrpc.php
eechen
eechen
演讲:由Lua粘合的Nginx生态环境
http://blog.zoomquiet.org/pyblosxom/oss/openresty-intro-2012-03-06-01-13.html
eechen
eechen
Nginx/Lua访问数据库的两种方法:

1.基于ngx_lua协程cosocket的驱动:
lua-resty-mysql
lua-resty-memcached
lua-resty-redis

2.Nginx模块:
ngx_drizzle (http://wiki.nginx.org/HttpDrizzleModule)
ngx_memc
ngx_redis2
ngx_postgres
eechen
eechen
ngx_openresty/lua编程(在CPU/内存消耗上要比PHP-FPM少得多),下面是两个测试:
http://www.cnbeta.com/articles/181315.htm
http://bluehua.org/demo/php.node.lua.html
eechen
eechen
技术博客:
https://github.com/agentzh/nginx-tutorials

配置指令/API等信息:
http://wiki.nginx.org/HttpLuaModule

讨论区:
https://groups.google.com/forum/#!forum/openresty

Web框架lapis:
http://leafo.net/lapis/

Lua集成开发环境LDT:
http://www.eclipse.org/koneki/ldt

Lua5.1参考手册:
http://www.codingnow.com/2000/download/lua_manual.html
返回顶部
顶部