From: Jason Richey Date: Wed, 29 Nov 2006 23:13:59 +0000 (+0000) Subject: moved the status call so it is only called if max_lag is set, since that is the only... X-Git-Tag: 1.31.0-rc.0~55030 X-Git-Url: http://git.cyclocoop.org/%24href?a=commitdiff_plain;h=21850be40cf422b993aeb8c90f6d1ae672379ddf;p=lhc%2Fweb%2Fwiklou.git moved the status call so it is only called if max_lag is set, since that is the only time it's value is useful. This won't help Wikimedia, but it should help users who are not using multiple DB servers+max_lag --- diff --git a/includes/LoadBalancer.php b/includes/LoadBalancer.php index 3690b43a1e..396ef865be 100644 --- a/includes/LoadBalancer.php +++ b/includes/LoadBalancer.php @@ -174,10 +174,9 @@ class LoadBalancer { unset( $loads[$i] ); $sleepTime = 0; } else { - $status = $this->mConnections[$i]->getStatus("Thread%"); - if ( isset( $this->mServers[$i]['max threads'] ) && - $status['Threads_running'] > $this->mServers[$i]['max threads'] ) - { + if ( isset( $this->mServers[$i]['max threads'] ) ) { + $status = $this->mConnections[$i]->getStatus("Thread%"); + if ( $status['Threads_running'] > $this->mServers[$i]['max threads'] ) { # Too much load, back off and wait for a while. # The sleep time is scaled by the number of threads connected, # to produce a roughly constant global poll rate. @@ -185,9 +184,13 @@ class LoadBalancer { # If we reach the timeout and exit the loop, don't use it $i = false; - } else { + } else { $done = true; $sleepTime = 0; + } + } else { + $done = true; + $sleepTime = 0; } } } else {