Spreading key/value pairs across multiple memcached servers

Christopher Schmidt crschmidt at wedu.com
Wed Dec 1 08:39:35 PST 2004

On Dec 1, 2004, at 11:25 AM, Chris Hartjes wrote:

> I had a chat about this with my boss, and his concern is not that we
> distribute the keys evenly, his concern is distributing the request to
> find out what server a key is sitting on.  I figure he doesn't want
> the first memcached server getting constantly pounded with requests
> for the location of a key, while the second server could be helping
> out in that regards.

The location of the key is determined in the client, by the hashing 
algorithm. Only one request for a key is ever made:

ADD data1:abc -> hash -> server1
ADD data2:bcd -> hash -> server2

GET data2:
data2->hash = server 2

There is no overload on the servers checking where the key is: it's 
alwyas in exactly one place.

Christopher Schmidt
crschmidt at wedu.com

More information about the memcached mailing list