nginx, echo module & lua

agentzh agentzh at gmail.com
Thu May 3 12:52:55 UTC 2012


On Thu, May 3, 2012 at 3:53 PM, Antonio P.P. Almeida <appa at perusio.net> wrote:
> A little thread hijacking. Are there plans to provide an HTTP response
> parser? I suppose that for performance reasons that would have to
> be in C along the lines of the Redis parser.
>
> https://github.com/agentzh/lua-redis-parser
>
> That's what's missing, IMHO, in order to completely replace
> luasocket.
>

Liseen Wan has been working on the lua-resty-http library:

    https://github.com/liseen/lua-resty-http

We'll extend that to support more and more HTTP features in the near future.

But I think it will remain pure Lua because introducing C may not
really help here given the performance of LuaJIT 2.0 (and it has
already been proven in lua-resty-mysql where rewriting the MySQL
packet parser in C actually slowed things down because going across
language boundary is more expensive).

But anyway we can provide pure C API for ngx_lua cosocket, just like
ngx_http_upstream, so a pure C implementation for those lua-resty-*
library will have a chance to achieve better performance than the pure
Lua implementations, but I'm not 100% sure ;)

Regards,
-agentzh



More information about the nginx mailing list