lua parser and redis2 questions

agentzh agentzh at gmail.com
Mon Jun 6 18:55:43 MSD 2011


On Mon, Jun 6, 2011 at 7:16 PM, logar.damir <nginx-forum at nginx.us> wrote:
> Agentzh, how about when using select
> (http://www.redis.io/commands/select) to select specific database #.
> Does pipelining work ok in this case?
>
> My command at the moment is:
> redis2_query select 2;
> redis2_query evalsha $sha1keyvickrey 1 $val;
> redis2_query select 0;
> redis2_pass redisbackend;
>

Your sample above should work. If not, please consider filing a bug
ticket on GitHub ;)

> Are this 3 redis2_query commands running on the same connection?

Yes. What I meant in my last email is that there is no such guarantee
across multiple nginx (sub-)requests. Your pipelined redis commands
specified in the same nginx location are always sent on one single
redis TCP connection. So you shouldn't worry about that in this
context.

> If not,
> could you maybe add another variable for database number. Simething
> similar to HttpRedis that has $redis_db (The number of redis database)
> which I think is broken (http://forum.nginx.org/read.php?2,203861).
>

No, I do not want ngx_redis2 to mud with specific redis command
details because the consistency and simplicity of its uniformed wired
protocol is one of the beauties and powers of redis. Leveraging the
redis pipelining feature of ngx_redis2 is sufficient.

Regards,
-agentzh



More information about the nginx mailing list