Why not let the fs handle this ??

timeless time at digg.com
Wed Jun 7 20:28:00 UTC 2006


Constantin B wrote:

> How do you manage the tcptimeout to connect to memcache server when 
> its "half/down" , the timeout must be very low ?
>
>     Actually, what you want to do is keep the server in the pool, but flag
>     it as down
>
That's where the "flag it as down" becomes important. Make your 
memcached server list something like:

("10.0.0.1," 11211, "up"),
("10.0.0.2", 11211, "up"),
("10.0.0.3", 11211, "up")

Change "up" to "down" when a server goes down. Write your memcached 
client so the hashing algorithm entirely ignores "up" or "down" -- But 
the get(), set(), etc *DO* pay attention such that every operation fails 
on a "down" server without even attempting to make a call to the 
Memcached server.

Thus the key always hashes to the same server, but the client doesn't 
hang waiting on a Memcached server that doesn't exist to answer the 
get() calls.

Others have recommended that if the hash lands on a server that's "down" 
that you rehash on the remaining servers and store the key there. I 
personally lean toward the "make everything a cache miss" solution 
because, as noted, flapping servers will cause inconsistent results in 
the cache.

--
timeless

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.danga.com/pipermail/memcached/attachments/20060607/2f4a4f15/attachment.html


More information about the memcached mailing list