On 02/mai - 19:46, agentzh wrote:
> Hello!
>
> On Wed, May 2, 2012 at 4:11 PM, Pierre <serarien@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.
ok
>
> But you're encouraged to try out ngx_lua's cosocket API to avoid
> subrequests altogether. And the cosocket stuff does not have such
> limitations.
hmm, any more documentation about that ?
More about: how to implement it in my lua scripts ?
is that it ? :
local tcp = ngx.socket.tcp
function new(self)
return setmetatable({ sock = tcp() }, mt)
end
?
>
> There's already several Lua drivers based on that, including
> memcached, redis, mysql, http, and mongodb. For instance, the
> lua-resty-redis library:
mongodb: you mean mongofs or mongodb ?
>
> https://github.com/agentzh/lua-resty-redis
>
> > 2. when in config: set_by_lua_file $varname luafile.lua , and luafile.lua
> > 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 work.
> > Would anybody suggest
> > me a workaround ?
> >
>
> This is indeed a bug. Thanks for reporting this!
>
> I've just committed a patch for it:
>
> https://github.com/chaoslawful/lua-nginx-module/commit/bee1cab
woh, thx !
>
> Could you try out the git master HEAD on your side?
I will
>
> Thanks!
> -agentzh
>
> _______________________________________________
> nginx mailing list
> nginx@nginx.org
> http://mailman.nginx.org/mailman/listinfo/nginx
_______________________________________________
nginx mailing list
nginx@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx