r58181 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r58180‎ | r58181 | r58182 >
Date:06:57, 27 October 2009
Author:midom
Status:ok
Tags:
Comment:
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
Modified paths:
  • /trunk/phase3/includes/memcached-client.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/memcached-client.php
@@ -262,7 +262,7 @@
263263 $this->_timeout_microseconds = 0;
264264
265265 $this->_connect_timeout = 0.01;
266 - $this->_connect_attempts = 3;
 266+ $this->_connect_attempts = 2;
267267 }
268268
269269 // }}}
@@ -704,15 +704,6 @@
705705 $timeout = $this->_connect_timeout;
706706 $errno = $errstr = null;
707707 for ($i = 0; !$sock && $i < $this->_connect_attempts; $i++) {
708 - if ($i > 0) {
709 - # Sleep until the timeout, in case it failed fast
710 - $elapsed = microtime(true) - $t;
711 - if ( $elapsed < $timeout ) {
712 - usleep(($timeout - $elapsed) * 1e6);
713 - }
714 - $timeout *= 2;
715 - }
716 - $t = microtime(true);
717708 if ($this->_persistant == 1)
718709 {
719710 $sock = @pfsockopen($ip, $port, $errno, $errstr, $timeout);

Status & tagging log