Mobile Number Tracker
Trace Mobile Number Earn Money Online
© TechWelkin.com

MediaWiki: Find Number of Jobs Pending in Job Queue

Tips for increasing MediaWiki performance.
Samyak Lalit | July 29, 2012 (Last update: September 22, 2017)

Samyak Lalit is an Indian author and disability rights activist. He is the principal author and founder of projects like TechWelkin, WeCapable, Viklangta, Kavita Kosh among many others.

MediaWiki is a robust content management system written for community use. It provides you with a great number of features that makes an administrator’s life easier. One such feature is job queue. Because MediaWiki has been designed to be simultaneously used and edited by a large number of people –it is imperative to have some sort of job queue in order to execute database update jobs at a time when the system is not too busy. The preference is given to the user requests and update jobs are run when system has time and computing power available.

In earlier versions of MediaWiki, Special:Statistics pages used to show the number of jobs in queue that are waiting to be executed. In version 1.19 and later Special:Statistics page does not show pending job count. You can however use MediaWiki API to find out this information. Go to the following page to see the number of pending jobs:

/api.php?action=query&meta=siteinfo&siprop=statistics

Tips for increasing MediaWiki performance.

This will show you a piece of XML in which “jobs=” property shows the pending job count. For example:

<?xml version="1.0"?>
<api>
  <query>
    <statistics pages="27799397" articles="4013331" edits="547280015" images="789151" users="17204375" activeusers="130014" admins="1463" jobs="27" />
  </query>
</api>

The above example shows that 27 jobs are pending in the job queue.

Please note that use of API should be enabled in LocalSettings.php before you can make use of the above path. The rate of execution of jobs can be controlled by setting $wgJobRunRate variable in LocalSettings.php. By default one job is executed every time a wiki page is requested by the user. If the server load is too high, you can use $wgJobRunRate to lower the number of jobs per request. For example:

$wgJobRunRate = 0.01;

This will make sure that one job is executed at every ten requests. It is one of the important MediaWiki performance optimization trick. If your wiki is heavily edited, it is better to keep an eye on job queue and see how fast jobs are getting executed. This would give you an idea about the ideal value to be set for $wgJobRunRate variable.

I hope this tip was useful for you. Do let me know if you have any questions.

© TechWelkin.com

Leave a Reply

Your email address will not be published. Required fields are marked *