Index: trunk/phase3/includes/db/LoadMonitor.php |
— | — | @@ -18,7 +18,7 @@ |
19 | 19 | * @param LoadBalancer $parent |
20 | 20 | */ |
21 | 21 | function __construct( $parent ); |
22 | | - |
| 22 | + |
23 | 23 | /** |
24 | 24 | * Perform pre-connection load ratio adjustment. |
25 | 25 | * @param $loads array |
— | — | @@ -30,13 +30,13 @@ |
31 | 31 | /** |
32 | 32 | * Perform post-connection backoff. |
33 | 33 | * |
34 | | - * If the connection is in overload, this should return a backoff factor |
35 | | - * which will be used to control polling time. The number of threads |
| 34 | + * If the connection is in overload, this should return a backoff factor |
| 35 | + * which will be used to control polling time. The number of threads |
36 | 36 | * connected is a good measure. |
37 | 37 | * |
38 | 38 | * If there is no overload, zero can be returned. |
39 | 39 | * |
40 | | - * A threshold thread count is given, the concrete class may compare this |
| 40 | + * A threshold thread count is given, the concrete class may compare this |
41 | 41 | * to the running thread count. The threshold may be false, which indicates |
42 | 42 | * that the sysadmin has not configured this feature. |
43 | 43 | * |
— | — | @@ -50,7 +50,7 @@ |
51 | 51 | * |
52 | 52 | * @param $serverIndexes |
53 | 53 | * @param $wiki |
54 | | - * |
| 54 | + * |
55 | 55 | * @return array |
56 | 56 | */ |
57 | 57 | function getLagTimes( $serverIndexes, $wiki ); |
— | — | @@ -113,7 +113,7 @@ |
114 | 114 | global $wgMemc; |
115 | 115 | if ( empty( $wgMemc ) ) |
116 | 116 | $wgMemc = wfGetMainCache(); |
117 | | - |
| 117 | + |
118 | 118 | $masterName = $this->parent->getServerName( 0 ); |
119 | 119 | $memcKey = wfMemcKey( 'lag_times', $masterName ); |
120 | 120 | $times = $wgMemc->get( $memcKey ); |
— | — | @@ -167,6 +167,8 @@ |
168 | 168 | } |
169 | 169 | $status = $conn->getMysqlStatus("Thread%"); |
170 | 170 | if ( $status['Threads_running'] > $threshold ) { |
| 171 | + $server = $conn->getProperty( 'mServer' ); |
| 172 | + wfLogDBError( "LB backoff from $server - Threads_running = {$status['Threads_running']}\n" ); |
171 | 173 | return $status['Threads_connected']; |
172 | 174 | } else { |
173 | 175 | return 0; |