In describing the timeout there is a statement that is not completely correct, increase the timeout does not necessarily preclude or unfeasible memcache, only allows the system to wait for more concurrent connections, which is a large minority of the number of connections, this causes several problems and could simply be corrected if the timeout was increased and perform some tests.
To prove the concept and show that the connection does not wait if the server goes down:
<?PHP
while ( ++$loop < 10000 ) {
try {
$memcache = new Memcache;
@$memcache->pconnect( "127.0.0.1" , 11211 , 30 );
$loopset = 0;
$loopget = 0;
while ( ++$loopset < 50 ) {
if ( @$memcache->set( "foo" , "bar" ) === false ) {
echo "Fail!" . PHP_EOL;
}
}
while ( ++$loopget < 500 ) {
if ( @$memcache->get( "foo" ) === false ) {
echo "Fail!" . PHP_EOL;
}
}
if ( $loop % 100 == 0 ) {
echo "Try: " . $loop . PHP_EOL;
}
} catch ( Exception $e ) {
echo "Fail: " . $e->getMessage() . PHP_EOL;
}
}
?>
Replace with an invalid host and test the timeout will not make a difference! It serves only for connections to the socket that are occupied.
More detail about troubleshooting timeouts in memcached google code.