Page MenuHomePhabricator

Document wgPoolCounterConf DefaultSettings.php 'slots' configuration
Open, Needs TriagePublic

Description

Noticed while doing T234450, 'slots' isn't in the $wgPoolCounterConf config in DefaultSettings.php, but at least used in WMF production and is documented at https://www.mediawiki.org/wiki/Manual:$wgPoolCounterConf

/**
 * Configuration for processing pool control, for use in high-traffic wikis.
 * An implementation is provided in the PoolCounter extension.
 *
 * This configuration array maps pool types to an associative array. The only
 * defined key in the associative array is "class", which gives the class name.
 * The remaining elements are passed through to the class as constructor
 * parameters.
 *
 * @par Example using local redis instance:
 * @code
 *   $wgPoolCounterConf = [ 'ArticleView' => [
 *     'class' => PoolCounterRedis::class,
 *     'timeout' => 15, // wait timeout in seconds
 *     'workers' => 1, // maximum number of active threads in each pool
 *     'maxqueue' => 5, // maximum number of total threads in each pool
 *     'servers' => [ '127.0.0.1' ],
 *     'redisConfig' => []
 *   ] ];
 * @endcode
 *
 * @par Example using C daemon from https://www.mediawiki.org/wiki/Extension:PoolCounter:
 * @code
 *   $wgPoolCounterConf = [ 'ArticleView' => [
 *     'class' => PoolCounter_Client::class,
 *     'timeout' => 15, // wait timeout in seconds
 *     'workers' => 5, // maximum number of active threads in each pool
 *     'maxqueue' => 50, // maximum number of total threads in each pool
 *     ... any extension-specific options...
 *   ] ];
 * @endcode
 */
$wgPoolCounterConf = null;

Event Timeline

Reedy created this task.Nov 21 2019, 11:40 AM
Restricted Application added a subscriber: Aklapper. · View Herald TranscriptNov 21 2019, 11:40 AM
Reedy renamed this task from Document poolcounter DefaultSettings.php 'slots' configuration to Document wgPoolCounterConf DefaultSettings.php 'slots' configuration.Nov 21 2019, 11:40 AM

I don't fully grasp the terminology yet, but my understanding is that each task type, such as TranslateFetchTranslators can have work items (pools) that are uniquely identified, such as "TranslateFetchTranslators-$code". I believe that typically pool counter is used to limit concurrency per pool (e.g. surge of requests for one particular article), while the slots configuration limits concurrency per pool type.

Would it be sufficient to copy the description from the wiki page to DefaultSettings.php? If so, this would be a very simple task.