Pit Digger
Pit Digger

Reputation: 9800

Memcache Failover

I am using Memcache (Not memcacheD) . If I have 10 memcache servers and 1 of it fails does that get removed from pool automatically ? I mean when my application tries to make a request for cache will it ever try to get key data from that 1 failed server ?

Upvotes: 3

Views: 951

Answers (1)

daschl
daschl

Reputation: 1124

I don't think that it gets removed, but there is auto-failover provided if you have multiple nodes added. You can configure that failover behaviour here: http://php.net/manual/en/memcache.ini.php

Here is a quote from the documentation:

Failover may occur at any stage in any of the methods, as long as other servers are available the request the user won't notice. Any kind of socket or Memcached server level errors (except out-of-memory) may trigger the failover. Normal client errors such as adding an existing key will not trigger a failover.

Of course, this assumes that all data is mirrored on those nodes, because you have to implement sharding/clustering on your application side.

Upvotes: 2

Related Questions