Memcache failover and consistent hashing
- by Industrial
Hi everyone,
I am trying to work out a good way to handle offline/down memcached servers in my current web application that are built with PHP.
I just found this link that shows an approach on how to do what I want, I think: http://cmunezero.com/2008/08/11/consistent-memcache-hashing-and-failover-with-php/
Anyhow, it gets me confused when I start working with it and reading the PHP documention about failover with memcache. Why is offline memcache servers added to the $realInstance server pool together with the online servers?
Reading the memcache documentation confuses me even more:
http://www.php.net/manual/en/memcache.addserver.php
status
Controls if the server should be flagged as online. Setting this
parameter to FALSE and retry_interval
to -1 allows a failed server to be
kept in the pool so as not to affect
the key distribution algorithm.
Requests for this server will then
failover or fail immediately depending
on the memcache.allow_failover
setting. Default to TRUE, meaning the
server should be considered online.
Thanks,