Topic on Talk:PoolCounter

PoolCounter warnings/errors on MW.1.35

4
Summary by Krinkle

"poolcounter should run as a standalone service"

S0ring (talkcontribs)

With the installed software

Software Version
MediaWiki 1.35.3
Pool Counter Client – (e1d5b5c)13:57, 13. Jul. 2020

the following warnings/errors occur:

Warning: count(): Parameter must be an array or an object that implements Countable in /var/www/html/extensions/PoolCounter/includes/PoolCounter_ConnectionManager.php on line 23

Warning: Invalid argument supplied for foreach() in /var/www/html/extensions/PoolCounter/includes/PoolCounter_ConnectionManager.php on line 34

Notice: Undefined variable: hostName in /var/www/html/extensions/PoolCounter/includes/PoolCounter_ConnectionManager.php on line 59


Would this indicate a php compability issue?

Legoktm (talkcontribs)

What's your PoolCounter configuration?

S0ring (talkcontribs)

Below is the configuration, but the warnings/errors occur when $wgPoolCountClientConf is enabled only.

wfLoadExtension( 'PoolCounter' );

// Configuration for standard searches.

$wgPoolCounterConf[ 'CirrusSearch-Search' ] = [

       'class' => 'PoolCounter_Client',

       'timeout' => 30,

       'workers' => 25,

       'maxqueue' => 50,

];

// Configuration for prefix searches.  These are usually quite quick and

// plentiful.

$wgPoolCounterConf[ 'CirrusSearch-Prefix' ] = [

       'class' => 'PoolCounter_Client',

       'timeout' => 10,

       'workers' => 50,

       'maxqueue' => 100,

];

// Configuration for regex searches.  These are slow and use lots of resources

// so we only allow a few at a time.

$wgPoolCounterConf[ 'CirrusSearch-Regex' ] = [

       'class' => 'PoolCounter_Client',

       'timeout' => 30,

       'workers' => 10,

       'maxqueue' => 10,

];

// Configuration for funky namespace lookups.  These should be reasonably fast

// and reasonably rare.

$wgPoolCounterConf[ 'CirrusSearch-NamespaceLookup' ] = [

       'class' => 'PoolCounter_Client',

       'timeout' => 10,

       'workers' => 20,

       'maxqueue' => 20,

];

$wgPoolCountClientConf = [

       'servers' => "127.0.0.1:8003",

       'timeout' => 0.5

];

I enabled it in order to avoid the error:

mediawiki [poolcounter] Pool key 'CirrusSearch-Search:_elasticsearch' (CirrusSearch-Search): Error connecting to pool counter server 127.0.0.1: Connection refused

S0ring (talkcontribs)

My bad, I misunderstood the setup in this case, poolcounter should run as a standalone service/daemon which in my case it didn't.