nginx, echo module & lua
Antonio P.P. Almeida
appa at perusio.net
Thu May 3 07:53:39 UTC 2012
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.
That's what's missing, IMHO, in order to completely replace
Great work as usual.
> On 02/mai - 19:46, agentzh wrote:
>> On Wed, May 2, 2012 at 4:11 PM, Pierre <serarien at baqs.net> wrote:
>> > I'm trying to use both echo module & lua, but I'm having some issues:
>> > 1. I reach quickly "subrequests cycle". Looking @ the code,
>> subrequests is
>> > unsigned:8,
>> > but I would need thousands of subrequests sometimes. putting
>> subrequests to
>> > unsigned just
>> > results to crashes.
>> There's no way to support thousands of subrequests in a single main
>> request without patching the nginx core.
>> But you're encouraged to try out ngx_lua's cosocket API to avoid
>> subrequests altogether. And the cosocket stuff does not have such
>> There's already several Lua drivers based on that, including
>> memcached, redis, mysql, http, and mongodb. For instance, the
>> lua-resty-redis library:
> how can I combine cosocket & foreign upstream ?
> also, I didn't find any example involving cosocket between locations, or
> I'm getting it wrong.
>> > 2. when in config: set_by_lua_file $varname luafile.lua , and
>> > references to ngx.ctx,
>> > I get the following error:
>> > (lua-error)...no request ctx found
>> > according to the doc, ngx.ctx is available in set_lua*, but does not
>> > Would anybody suggest
>> > me a workaround ?
>> This is indeed a bug. Thanks for reporting this!
>> I've just committed a patch for it:
> works like a charm, thanks !
>> Could you try out the git master HEAD on your side?
>> nginx mailing list
>> nginx at nginx.org
> nginx mailing list
> nginx at nginx.org
More information about the nginx