Hello!
On Mon, Sep 23, 2013 at 7:00 AM, Pat Gunn wrote:
> I'm prototyping a server based on this, and was trying to figure out
> if it's doing connection pooling (running into performance issues when
> I scale it very high),
I'm not sure what exactly are you using because I've built two
different Redis clients for Nginx:
http://wiki.nginx.org/HttpRedis2Module
https://github.com/agentzh/lua-resty-redis
The former is an Nginx upstream module written in C and the latter is
a Lua library based on ngx_lua's cosocket API.
> and stumbled onto your website, where you list
> lua-resty-redis but not lua-nginx-redis.
>
I never used the name lua-nginx-redis. Maybe the Debian packager
changes the name himself. Not sure though.
> Is what Debian ships just a renamed version of your module, or did the
> module change names at some point?
No idea. I've never participated in any Debian packaging things for my
projects. Ask your Debian package maintainers instead.
> I gather that the keepalive stuff
> is handled through the tcp() call, which is in turn handled at a lower
> level?
Okay, it seems that you're using my lua-resty-redis library. The tcp()
call is actually the ngx.socket.tcp() call provided by the ngx_lua
module:
http://wiki.nginx.org/HttpLuaModule#ngx.socket.tcp
> Is keepalive enabled by default?
No, you should call the set_keepalive() method when you no longer need
the current redis connection. See
https://github.com/agentzh/lua-resty-redis#set_keepalive
> If I want keepalive, should I
> not call red:close() ?
>
No never. close() always close the connection right away, as the
method name implies. The set_keepalive() should always be called in
the place of close().
I'm cc'ing the openresty-en mailing list:
https://groups.google.com/group/openresty-en You're recommended to
discuss such things there too.
Best regards,
-agentzh