On Fri, May 18, 2012 at 6:18 PM, Tzury Bar Yochay <tz...@reblaze.com>
I want to add redis to my setup so two or more instances of ngx/lua can shared data across the network.
I have looked at your work in the subject and wonder if:
- having Lua communicate directly with the redis instead of via ngx can improve performance.
Using 3rd-party Lua modules may ruin the performance. You're strongly recommended to use one of the following components:
1. The lua-resty-redis library based on ngx_lua cosocket:
2. The ngx_redis2 module with the lua-redis-parser library:
Both of these components are 100% non-blocking and play well with the nginx event model.
The 1st way is even more recommended due to its simplicity, flexibility, and also raw performance.
- are you familiar with any of those two and can tell one is better than the other.
Both the lua-hiredis and lua-redis will block your nginx tragically and the maximal concurrency level will drop dramatically.
- is there a better solution (better == lighter and faster) that you can recommend?
Sure. See above :)