Force memcached to write to all servers in pool
- by Industrial
Hi everyone,
I have thought a bit on how to make sure that a particular key is distributed to ALL memcached servers in a pool.
My current, untested solution is to make another instance of memcached, something like this:
$cluster['local'] = array('host' => '192.168.1.1', 'port' => '11211', 'weight' => 50);
foreach ($this->cluster() as $cluster) {
@$this->tempMemcache = new Memcache;
@$this->tempMemcache->connect($cluster['host'], $cluster['port']);
@$this->tempMemcache->set($key, $value, $this->compress, $expireTime);
@$this->tempMemcache->close();
}
What is common sense to do in this case, when certain keys need to be stored on ALL servers for reliability?