Better server selection client code?

Timo Ewalds timo at tzc.com
Fri Oct 20 17:28:38 UTC 2006


Andrew Harbick wrote:
>> This approach seems like it would make redundancy slightly trickier 
>> to implement. With the circular method outlined in the paper 
>> redundant storage can be achieved by storing keys on the N servers 
>> following the first matching server and then removing servers from 
>> the circle as they fail.
>
> I wasn't going for redundancy.  The default client doesn't either.  My 
> goal was simply to get the client to choose a server for a given key 
> such that adding servers didn't cause the client to choose a different 
> server for EVERY key upon the addition of that new server.
>
> Basically, I can add memcache servers to my fleet and not cause the 
> cache to effectively be flushed.
>
It should be possible to flush even less of the cache space than the 
method you're proposing. Instead of moving all servers over a bit, all 
of them losing some keys to its neighbor, you could have them all lose 
some of their cache space to give to the new server. The new server 
would then have as many segments as there were servers before. If you 
were adding many servers at a time, this fragmentation wouldn't be as 
severe. This fragmentation would mean a significant increase in 
complexity, possibly to the point of not being worth doing. I haven't 
figured out how much cache space your method invalidates, but this one 
invalidates exactly as much as you are adding making it as efficient as 
is possible (I think).

Timo


More information about the memcached mailing list