Getting rid of the $number response without lua
Hello there. I'm willing to use the redis2 module to retrieve static files from my redis DB and to return them as is. For some reason, although according to documentation I get a $number as the first line of the response. The way it's described in the README: ... then GET /pipelined will yield two successive raw Redis responses +OK $5 world
It's not really clear why is the $5 ever needed. I understand I can use LUA to get rid of it, but that seems like an unnecessary overhead.
Thanks.
Hello!
On Tue, Jan 8, 2013 at 8:19 AM, svarogg [email protected] wrote:
I'm willing to use the redis2 module to retrieve static files from my redis DB and to return them as is. For some reason, although according to documentation I get a $number as the first line of the response. The way it's described in the README: ... then GET /pipelined will yield two successive raw Redis responses +OK $5 world
It's not really clear why is the $5 ever needed.
As documented, ngx_redis2 returns the raw Redis responses. The "$5" stuff here is part of Redis' wire protocol format:
http://redis.io/topics/protocol
I understand I can use LUA to get rid of it, but that seems like an unnecessary overhead.
Have you ever actually measured the performance difference between these two? (You're recommended to use LuaJIT to speed it up.) If not, just try it and I think you'll probably be amazed :)
Best regards, -agentzh
Can you help me to get rid of the number format using Lua or any other possible ways, Thanks
Hello!
On Thu, Mar 7, 2013 at 11:55 PM, gauravt [email protected] wrote:
Can you help me to get rid of the number format using Lua or any other possible ways, Thanks
Just use the lua-resty-redis library:
https://github.com/agentzh/lua-resty-redis
Best regards, -agentzh