Introductionmagent is a proxy server sitting between memcache clients(such as php programs) and memcached servers. magent have several advantages over direct connections Client
|
Magent
|
|--|--|-------------------|--|--|
| | | | | |
Normal Servers Farm Backup Servers Farm
Details- get gets command goes to normal servers farm. If one server failed, magent will try read from backup servers farm
- If get gets command had multi keys, magent will walk every key one by one as above.
- delete incr decr add set replace prepend append cas command goes to both normal servers farm and backup servers fram at the same time
- When client disconnected from magent, magent will keep connections to servers farm instead of close them.
- One great advantage of n-servers ketama is that only 1/n portion keys reallocate when one server was added/removed from ketama.
Suggestions- run magent on the same server which client runs. client connects to 127.0.0.1, which is faster
|
If you add this to magent.c
#ifndef SSIZE_MAX #define SSIZE_MAX ((~((size_t) 0)) / 2) #endif
memagent will build on mac os x. Not sure why SSIZE_MAX is undefined in the first place, but this is a working fix.
On linux, the SSIZE_MAX is defined in limits.h add #include <limits.h> in magent.c
Hi,
I want to use Magent to access memcached server to validate session. Required behaviour: My webserver is lighttppd. If browser requests a resource, lighthttpd must validate the sesssion based on cookie with memcached server through magent and then server the resource.
hi,shell code. My work have something about memcached. Would you pls join me to the project? Thank you!