yiisoft / yiisoft/yii2-queue

[yii\queue\db\Queue::reserve()] is extremely slow if there are many delayed jobs

Open
#280 0 comments 3 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

type:bug
Dominant language
PHP
Stars
1.1k
Forks
285
Avg merge
5d 3h
Merged PRs (30d)
2

Description

What steps will reproduce the problem?

Make DB queue with 200k+ jobs on delayed list

What's expected?

fetching jobs from queue should be fast

What do you get instead?

since fetching jobs from queue takes 3+ seconds, additional workers get mutex timeout

Additional info
Q A
Yii version 2.0.15.1
PHP version 7.2.9
Operating system Debian 9

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start at yii\queue\db\Queue::reserve() and reproduce the slowdown with 200k or more delayed jobs. Measure job fetching and mutex behavior, then verify that fetching is fast enough to avoid additional workers timing out; the issue provides no test file or other entry point.

Written by the indexing model from the issue text.

Assessment

Tech stack
php
Domain
database
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
38/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.