openresty / memc-nginx-module

An extended version of the standard memcached module that supports set, add, delete, and many more memcached commands.
http://wiki.nginx.org/NginxHttpMemcModule
213 stars 56 forks source link

Binary protocol mode #15

Closed kayrus closed 10 years ago

kayrus commented 10 years ago

Is it possible to implement binary memcached protocol for memc module?

agentzh commented 10 years ago

@kayrus It would be a lot of work to add support for an alternative protocol (it is essentially writing another nginx C module). I think it's better and much easier to add binary protocol support to the lua-resty-memcached library for the ngx_lua module:

https://github.com/agentzh/lua-resty-memcached

kayrus commented 10 years ago

Would it be less complicated to use libmemcached?

agentzh commented 10 years ago

@kayrus Then you'll have to figure out how to integrate libmemcached's nonblocking API with Nginx's event loop, which is potentially harder, given the existing similar efforts like the ngx_drizzle (for libdrizzle integration) and ngx_postgres (for libpq integration).

And it seems that someone was having problems with this direction when using libmemcached in his nginx module: http://stackoverflow.com/questions/15601340/libmemcached-memcached-mget-seems-to-block Not sure about the technical details there though. I'm not familiar with libmemcached after all.

kayrus commented 10 years ago

Thanks for the explanation