How to handle memcached server down???

519 views
Skip to first unread message

Evil Boy 4 Life

unread,
Mar 4, 2011, 6:46:36 AM3/4/11
to memcached
Hi,
I use the .net clients and 2 servers at 2 different machines.
When one of the memcached servers is down, I try to set an item to the
cache (According the hashing algorithm of the client, this item should
stored the inactive server!) and this item get stored at the active
server.
After I set the item, the second server get back to work. Now if I'll
try to get this item I won't succeed, because the client will searche
the item at the second server (According the hashing algorithm).

What can i do to solve this problem???
(To set the item again at the second server isn't a solution, because
I don't want to store any item at 2 servers)

Nelz

unread,
Mar 7, 2011, 5:05:48 PM3/7/11
to memc...@googlegroups.com
This is not a problem, this is the way that memcache is designed.

When your formerly failed memcached server comes back up and you
request the item from it, it will miss. Ideally this is when you go
recalculate whatever the value is and you then set it in the 'proper'
cache.

Also, consider that when your 2nd memcached server is down, you'll put
into the 1st server on its first miss, but any subsequent requests
(until the 2nd comes back up) are getting served appropriately by the
first.

After the second server comes back up, over time the 'duplicate' on
the first server will be purged from memory because it will end up as
Least-Recently-Used data.

- Nelz

Reply all
Reply to author
Forward
0 new messages