https://bugzilla.wikimedia.org/show_bug.cgi?id=42614

       Web browser: ---
             Bug #: 42614
           Summary: JobQueueDB::claimRandom seems very slow with lots of
                    jobs
           Product: MediaWiki
           Version: 1.21-git
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: normal
          Priority: Unprioritized
         Component: JobQueue
        AssignedTo: [email protected]
        ReportedBy: [email protected]
    Classification: Unclassified
   Mobile Platform: ---


mysql> EXPLAIN SELECT /* JobQueueDB::claimRandom 127.0.0.1 */ * FROM `job`
WHERE job_cmd = 'MessageGroupStatesUpdaterJob' AND job_token = '' AND
(job_random <= '2108540693') ORDER BY job_random DESC LIMIT 1;
+----+-------------+-------+------+----------------------------------------+---------------+---------+-------------+-------+-------------+
| id | select_type | table | type | possible_keys                          |
key           | key_len | ref         | rows  | Extra       |
+----+-------------+-------+------+----------------------------------------+---------------+---------+-------------+-------+-------------+
|  1 | SIMPLE      | job   | ref  | job_cmd,job_cmd_token,job_cmd_token_id |
job_cmd_token | 96      | const,const | 43440 | Using where |
+----+-------------+-------+------+----------------------------------------+---------------+---------+-------------+-------+-------------+
1 row in set (0.00 sec)

mysql> SELECT /* JobQueueDB::claimRandom 127.0.0.1 */ * FROM `job` WHERE
job_cmd = 'MessageGroupStatesUpdaterJob' AND job_token = '' AND (job_random <=
'2108540693') ORDER BY job_random DESC LIMIT
1;+--------+------------------------------+---------------+--------------------------------------------------------+----------------+------------+------------+-----------+---------------------+---------------------------------+--------------+
| job_id | job_cmd                      | job_namespace | job_title            
                                 | job_timestamp  | job_params | job_random |
job_token | job_token_timestamp | job_sha1                        |
job_attempts |
+--------+------------------------------+---------------+--------------------------------------------------------+----------------+------------+------------+-----------+---------------------+---------------------------------+--------------+
| 447774 | MessageGroupStatesUpdaterJob |          1202 |
Konsolekalendar-e2ca93-Add_location_to_incidence_(f/en | 20121201204852 |
a:0:{}     | 2108426131 |           | NULL                |
f78vrjeo5e8f17ackthos9uhjzw686y |            0 |
+--------+------------------------------+---------------+--------------------------------------------------------+----------------+------------+------------+-----------+---------------------+---------------------------------+--------------+
1 row in set (3.62 sec)


It's going to take ages to clear all the jobs if picking each one takes 3
seconds.

php maintenance/showJobs.php 
86324

-- 
Configure bugmail: https://bugzilla.wikimedia.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.
You are on the CC list for the bug.

_______________________________________________
Wikibugs-l mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/wikibugs-l

Reply via email to