1
K,所以有一些麻煩與以下PHP Memcached的連接超時
$this->cacheServers = array(
array('test.com', 11211)
);
$this->memcache = new \Memcached();
$this->memcache->setOption(\Memcached::OPT_COMPRESSION, TRUE);
$this->memcache->setOption(\Memcached::OPT_LIBKETAMA_COMPATIBLE, TRUE);
$this->memcache->setOption(\Memcached::OPT_CACHE_LOOKUPS, TRUE);
$this->memcache->setOption(\Memcached::OPT_CONNECT_TIMEOUT, 50);
$this->memcache->setOption(\Memcached::OPT_POLL_TIMEOUT, 50);
$this->memcache->setOption(\Memcached::OPT_RECV_TIMEOUT, 10000);
$this->memcache->setOption(\Memcached::OPT_SEND_TIMEOUT, 10000);
$this->memcache->setOption(\Memcached::OPT_SERVER_FAILURE_LIMIT, 1);
$this->memcache->setOption(\Memcached::OPT_RETRY_TIMEOUT, 50);
$this->memcache->setOption(\Memcached::OPT_NO_BLOCK, TRUE);
$this->memcache->setOption(\Memcached::OPT_TCP_NODELAY, true);
$this->_data['connected'] = $this->memcache->addServers($this->cacheServers);
這樣的IM,即時通訊試圖讓它超時,但它只是掛起
似乎令人困惑的是,PHP有一個memcache和memcached擴展。 – cr125rider 2012-06-13 20:39:07
是的,有點新的 – Ascherer 2012-06-13 22:18:09
Memcache是更老,更糟糕的一個。 Memcached是更新,更好的一個。 – 2012-10-05 09:12:13