<div>
<blockquote class="gmail_quote" style="PADDING-LEFT: 1ex; MARGIN: 0px 0px 0px 0.8ex; BORDER-LEFT: #ccc 1px solid">The wiki explains the issue pretty well:<span class="q"><br><br><a onclick="return top.js.OpenExtLink(window,event,this)" href="http://www.socialtext.net/memcached/index.cgi?faq#how_does_memcached_handle_failover" target="_blank">
http://www.socialtext.net/memcached/index.cgi?faq#how_does_memcached_handle_failover</a><br><br></span>"With default clients <b>adding or removing</b> servers will invalidate all of your cache! Since the list of servers to hash against has changed, most of your keys will likely hash to different servers. It's like restarting all of your nodes at the same time."
<br><br>With a consistent hashing algorithm, node removal will not invalidate your cache, causing much less of an issue should you need to remove a node from the server pool.</blockquote></div>
<div> </div>
<div>So basically, by default, if a memcache server crashes, all caches that were kept there will continue to be invalid, until that IP comes back up? Or will it be re-routed elsewhere when the application sees it not being there and tries to recreate it?
</div>
<div> </div>
<div>Which consistent hash library is recommended to rectify this situation, if any?</div>
<div> </div>
<div> </div>
<div> </div>
<div> </div>
<div><br><br> </div>
<div><span class="gmail_quote">On 10/22/07, <b class="gmail_sendername">Rob Sharp</b> <<a href="mailto:rob.sharp@thesoundalliance.net">rob.sharp@thesoundalliance.net</a>> wrote:</span>
<blockquote class="gmail_quote" style="PADDING-LEFT: 1ex; MARGIN: 0px 0px 0px 0.8ex; BORDER-LEFT: #ccc 1px solid">
<div><span class="q">On Mon, 2007-10-22 at 13:53 +0800, K J wrote:<br>
<blockquote type="CITE">
<blockquote><font color="#000000">In our case, not really. It really depends on your current caching codebase. The only problem is the (current) lack of a consistent hashing algorithm [1] but YMMV. </font></blockquote></blockquote>
<blockquote type="CITE"><font color="#000000"> </font> </blockquote>
<blockquote type="CITE"><font color="#000000">What is the consistent hashing part and why is it a bad thing?</font> </blockquote>
<blockquote type="CITE"><font color="#000000"></font><br></blockquote></span>The wiki explains the issue pretty well:<span class="q"><br><br><a onclick="return top.js.OpenExtLink(window,event,this)" href="http://www.socialtext.net/memcached/index.cgi?faq#how_does_memcached_handle_failover" target="_blank">
http://www.socialtext.net/memcached/index.cgi?faq#how_does_memcached_handle_failover</a><br><br></span>"With default clients <b>adding or removing</b> servers will invalidate all of your cache! Since the list of servers to hash against has changed, most of your keys will likely hash to different servers. It's like restarting all of your nodes at the same time."
<br><br>With a consistent hashing algorithm, node removal will not invalidate your cache, causing much less of an issue should you need to remove a node from the server pool.<br><br>Hope that helps,<br>Rob. <br>
<table cellspacing="0" cellpadding="0" width="100%">
<tbody>
<tr>
<td>
<table cellspacing="3" cellpadding="0" width="100%"><td><span class="q">
<tbody>
<tr>
<td valign="top" colspan="2"><b><font size="2"><font color="#333333">Rob Sharp</font></font></b><br><font size="1"><font color="#ce4a84">Development Lead </font></font><br><br><b><font size="1">telephone:</font></b><font size="1">
02 9282 4038</font><br><b><font size="1">facsimile:</font></b><font size="1"> 02 9282 4099</font><br><b><font size="1">skype:</font></b><font size="1"> qu4nnum</font><br><br><br><br><br></td></tr></tbody></span>
<tr><td><span class="q">
<td valign="top" colspan="2"><font size="2"><font color="#333333">Sound Alliance </font></font><br><font size="1"><font color="#ce4a84">inthemix : FasterLouder : Thought By Them : SameSame</font></font> </td></span></td>
</tr></td></table></td></tr></tbody></table><br><font size="1">"Poor workers blame their tools. Good workers build better tools. The best workers get their tools to do the work for them." -- Syndicate Wars</font>
<span class="q"><br><br><font size="2"><font color="#339966">100% recycled electrons were used for the composition of this email </font></font><br><font size="2"><font color="#339966">- please don't print it unless you need to!
</font></font> </span></div></blockquote></div><br>