Manual:$wgJobRunRate
Empregos: $wgJobRunRate | |
---|---|
Número de jobs feitos por requisição. |
|
Introduzido na versão: | 1.6.0 (r13088) |
Removido na versão: | ainda em uso |
Valores permitidos: | (número >= 0) |
Valor padrão: | 1 |
Outras definições: Alfabético | Por função |
Detalhes
Número de jobs feitos por requisição. May be less than one in which case jobs are performed probabilistically. If this is 0, jobs will not be done during ordinary Apache requests. In this case, maintenance/runJobs.php should be run in loop every few seconds via a service or cron job. If using a cron job, be sure to handle the case where the script is already running (e.g. via "/usr/bin/flock -n <lock_file>"). If this is set to a non-zero number, then it is highly recommended that PHP run in fastcgi mode (php_fpm). When using a standard Apache PHP handler (mod_php), it is recommended that output_buffering and zlib.output_compression both be set to "Off", allowing MediaWiki to install an unlimited size output buffer on the fly. Setting output_buffering to an integer (e.g. 4096) or enabling zlib.output_compression can cause user-visible slowness as background tasks execute during web requests. Regardless of the web server engine in use, be sure to configure a sufficient number processes/threads in order to avoid exhaustion (which will cause user-visible slowness).
Explicação
A fila job foi desenhada para ter várias tarefas pequenas. Por padrão, cada vez que uma requisição é executada, um job é tirado da lista de jobs e é executado. Se a performance estiver muito prejudicada, você pode reduzir o valor de $wgJobRunRate colocando ele no seu $LocalSettings:
$wgJobRunRate = 0.01;
Isto vai fazer com que cada item na lista de jobs sejam executadas "em média" a cada 100 visualizações de página. It is important to understand that this means that on every page view the probability of running a queued item is 1 in 100. This means that (in theory at least) you could still end up with one job being run every page impression, or (at the other end of the scale) no jobs being run at all. However, in practice, providing you have enough traffic to make a meaningful sample size, it should be about 1 per 100 requests.
In some versions of MediaWiki, you can view the number of jobs at Special:Statistics. However, this number is a rough estimate, and thus misleading, so it was removed in 1.17 (r65059).
The job queue is located in MediaWiki.php , function triggerJobs()
(doJobs()
before 1.23).