Jump to content

매뉴얼:$wgJobRunRate

From mediawiki.org
This page is a translated version of the page Manual:$wgJobRunRate and the translation is 38% complete.
Outdated translations are marked like this.
Jobs: $wgJobRunRate
매번 요청에 수행할 작업의 개수
이 변수가 소개된 버전:1.6.0 (r13088)
이 변수가 사라진 버전:계속해서 쓰이고 있음
허용값:(정수 >= 0)
기본값:1

설명

매번 요청에 수행할 작업의 개수. 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).

이유

작업 대기줄 (job queue)는 많고 짧은 작업을 다루기 위해 설계되었습니다. 기본적으로 요청이 실행될때에, 작업대기줄에서 하나의 작업이 실행되어집니다. If the performance burden of this is too great, you can reduce $wgJobRunRate by putting something like this in your LocalSettings.php :

$wgJobRunRate = 0.01;

This will cause one item in the job queue to run on average every 100 page views. 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.

미디어위키의 어떤 버전에서는 작업의 개수를 $special 에서 볼 수 있습니다. However, this number is a rough estimate, and thus misleading, so it was removed in 1.17 (r65059).

In later versions, you can still view it by calling the API:

작업 큐는 MediaWiki.php triggerJobs() (1.23 이전에는 doJobs()) 에 위치합니다.

같이 보기