Ho il codice seguente:Memcache PHP - controlla se qualche server è disponibile nel pool?
$cluster['local'] = array('host' => '192.168.1.1', 'port' => '11211', 'weight' => 50);
$cluster['local2'] = array('host' => '192.168.1.2', 'port' => '11211', 'weight' => 50);
$this->memcache = new Memcache;
foreach ($this->cluster() as $cluster) {
$this->memcache->addServer($cluster['host'], $cluster['port'], $this->persistent, $cluster['weight'], 10, 10, TRUE , 'failure');
}
vorrei fare una funzione che controlla se uno dei miei assistenti nel mio Pool memcache è disponibile. Come si può fare?
Bel metodo, +1! =) –
Abbiamo finito con "memcache :: getExtendedStats()" da quando abbiamo scoperto che getServerStatus era un po 'inaffidabile. getExtendedStatus sembra dare sempre lo stato corretto dei server in tempo reale. – Industrial