From: Domas Mituzas Date: Tue, 27 Oct 2009 06:57:51 +0000 (+0000) Subject: first few changes to memcached client: X-Git-Tag: 1.31.0-rc.0~39088 X-Git-Url: https://git.cyclocoop.org/%7B%24admin_url%7Dcompta/operations/modifier.php?a=commitdiff_plain;h=4eaaf3c71660b897b7f1c9b9af776d297501aa20;p=lhc%2Fweb%2Fwiklou.git first few changes to memcached client: * reduce connect attempts from 3 to 2 * remove the backoff logic, which just doesn't make sense in datacenter environments --- diff --git a/includes/memcached-client.php b/includes/memcached-client.php index 7974530929..eb5478ed9e 100644 --- a/includes/memcached-client.php +++ b/includes/memcached-client.php @@ -262,7 +262,7 @@ class memcached $this->_timeout_microseconds = 0; $this->_connect_timeout = 0.01; - $this->_connect_attempts = 3; + $this->_connect_attempts = 2; } // }}} @@ -704,15 +704,6 @@ class memcached $timeout = $this->_connect_timeout; $errno = $errstr = null; for ($i = 0; !$sock && $i < $this->_connect_attempts; $i++) { - if ($i > 0) { - # Sleep until the timeout, in case it failed fast - $elapsed = microtime(true) - $t; - if ( $elapsed < $timeout ) { - usleep(($timeout - $elapsed) * 1e6); - } - $timeout *= 2; - } - $t = microtime(true); if ($this->_persistant == 1) { $sock = @pfsockopen($ip, $port, $errno, $errstr, $timeout);