[yii\queue\db\Queue::reserve()] is extremely slow if there are many delayed jobs
Open
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
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- 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