Hello!
On Fri, Nov 22, 2013 at 10:28 AM, Ajay k wrote:
>
> Is there any benchmark between the redis2-nginx-module and the
> lua-resty-redis in terms of memory efficiency
>
You're encouraged to do the benchmark yourself with your own data set
and queries. I don't have any concrete benchmark results off hand to
share.
According to the implementations, ngx.location.capture requires extra
memory buffers to *capture* the subrequest's response and the memory
buffers in Nginx subrequests will not be freed up until the end of the
main request, which both lead to (significantly) larger memory
footprint as compared to the very lightweight lua-resty-redis library
for nontrivial applications.
>
> How can we specify something like upstream redis_cluster using the connect
> from lua-resty -redis ( or should we have acustom lua code if an redis
> endpoint doesnt connect failover to next available redis server )
>
Well, you cannot mix lua-resty-redis with the upstream {} blocks. You
need to do the failover and load-balancing yourself, all in Lua, which
also opens the door for more flexibility.
Best regards,
-agentzh