简体   繁体   中英

php Memcached Connection timeout

k, so im having some troubles with the following

$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);

so, im trying to get it to timeout, but it just hangs

Implemented my own telnet test with fsockopen and a one second timeout.

Answering my own question yet again

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM