My favorites | Sign in
Project Logo
                
Search
for
Updated Sep 12, 2008 by shellcode
Labels: Featured, Phase-Design
HowMagentWorks  

Introduction

magent 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

  1. get gets command goes to normal servers farm. If one server failed, magent will try read from backup servers farm
  2. If get gets command had multi keys, magent will walk every key one by one as above.
  3. delete incr decr add set replace prepend append cas command goes to both normal servers farm and backup servers fram at the same time
  4. When client disconnected from magent, magent will keep connections to servers farm instead of close them.
  5. One great advantage of n-servers ketama is that only 1/n portion keys reallocate when one server was added/removed from ketama.

Suggestions

  1. run magent on the same server which client runs. client connects to 127.0.0.1, which is faster

Comment by quell...@mac.com, Oct 29, 2008

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.

Comment by drswinghead, Feb 10, 2009

On linux, the SSIZE_MAX is defined in limits.h add #include <limits.h> in magent.c

Comment by shyamkishore.k, Mar 17, 2009

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.

Can I make use of mgent for this? please help me asap as i am blocked because of this...
Comment by ZhengKarl, Jun 21, 2009

hi,shell code. My work have something about memcached. Would you pls join me to the project? Thank you!


Sign in to add a comment
Hosted by Google Code