Dead host detection and remapping keys to other memcached servers

Yusuf Goolamabbas
Mon, 24 Nov 2003 21:18:13 +0800

Hi, Just came across memcached and am playing with it
On a RH 9 box using libevent 0.7c (which uses poll) and memcached-1.1.9 with
Cache::MemCached 1.11 and the following test program

use Cache::Memcached;
$memd = new Cache::Memcached {
           'servers' => [ "" , "" ] ,
           'debug' => 1,
           'compress_threshhold' => 10000
my $obj = $memd->get("foo");
if ($obj) {
  print "$obj \n" ;
} else {
  $memd->set("foo", "bar");
  print "snafu\n" ;

The key is initally mapped to the server listening on port 2049, I
expected that if I shut down 2049, then the Perl API would then add the
key again on the server listening on port 2048 and subsequently the
results would be read from memcache. However, this does not seem to be
the case and until the 2049 server is started again, "snafu" keeps on
getting printed

Have I missed something obvious ?

Regards, Yusuf
If you're not using Firebird, you're not surfing the web 
   you're suffering it