<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=us-ascii">
<TITLE>Message</TITLE>
<META content="MSHTML 6.00.2900.3086" name=GENERATOR></HEAD>
<BODY>
<DIV><FONT face=Arial size=2>
<DIV><SPAN class=437202704-17052007><FONT face=Arial
size=2>Hello,</FONT></SPAN></DIV>
<DIV><SPAN class=437202704-17052007><FONT face=Arial
size=2></FONT></SPAN> </DIV>
<DIV><SPAN class=437202704-17052007><FONT face=Arial size=2>I am using the PECL
php extension for memcached access, and am confused/concerned about data
integrity in the case of a failure. I have already found some discussions on
this list regarding this issue, but I don't see how those solutions hold up in a
multi-server environment.</FONT></SPAN></DIV>
<DIV><SPAN class=437202704-17052007><FONT face=Arial
size=2></FONT></SPAN> </DIV>
<DIV><SPAN class=437202704-17052007><FONT face=Arial size=2>What I've found so
far is basically this: Disable automatic failover, use a callback method to
catch the failure and in that callback routine set the server status to off and
stop any further retrying (-1), and lastly, implement an external service
monitor that can detect the problem, flush the cache and then mark the server as
available again. That way, you can be sure all stale entries are flushed before
it rejoins the pool of active servers.</FONT></SPAN></DIV>
<DIV><SPAN class=437202704-17052007><FONT face=Arial
size=2></FONT></SPAN> </DIV>
<DIV><SPAN class=437202704-17052007><FONT face=Arial size=2>Fine for one client
accessing the cache server. But I don't see how that guarantees integrity
in a multi-client environment. In particular, I don't see how it works
when the failure is quite temporary, due to a heavy load that made the response
too sluggish. Hopefully I'm just overlooking the obvious and one of you
will straighten me out.</FONT></SPAN></DIV>
<DIV><SPAN class=437202704-17052007><FONT face=Arial
size=2></FONT></SPAN> </DIV>
<DIV><SPAN class=437202704-17052007><FONT face=Arial size=2>Let's imagine a
simple 3 machine setup (m1 - m3), where each machine is acting as a web server
and a memcached server.</FONT></SPAN></DIV>
<DIV><SPAN class=437202704-17052007><FONT face=Arial
size=2></FONT></SPAN> </DIV>
<DIV><SPAN class=437202704-17052007><FONT face=Arial size=2>m1 web -->
attempts write to m3 cache, but it fails due to extreme load. Marks it as failed
and offline (in the callback routine).</FONT></SPAN></DIV>
<DIV><SPAN class=437202704-17052007><FONT face=Arial size=2>m2 web -->
accesses m3 cache successfully (no load problem on m2, so no failure). Doesn't
see that m1 took it offline.</FONT></SPAN></DIV>
<DIV><SPAN class=437202704-17052007><FONT face=Arial
size=2></FONT></SPAN> </DIV>
<DIV><SPAN class=437202704-17052007><FONT face=Arial size=2>m2 is using invalid
cache data (it's missing m1's activity) but doesn't realize it. An external
service monitor may or may not notice this brief, intermittent problem, but even
if it does, that doesn't help m2 avoid the m3 cache once m1 has experienced an
m3 cache failure.</FONT></SPAN></DIV>
<DIV><SPAN class=437202704-17052007><FONT face=Arial
size=2></FONT></SPAN> </DIV>
<DIV><SPAN class=437202704-17052007><FONT face=Arial size=2>I'm sure I must be
missing something. Your help is greatly appreciated.</FONT></SPAN></DIV>
<DIV><SPAN class=437202704-17052007><FONT face=Arial
size=2></FONT></SPAN> </DIV>
<DIV><SPAN class=437202704-17052007><FONT face=Arial
size=2>Thanks,</FONT></SPAN></DIV>
<DIV><SPAN class=437202704-17052007><FONT face=Arial
size=2>Kenner</FONT></SPAN></DIV></FONT></DIV></BODY></HTML>