Skip to content

Conversation

@tomgi
Copy link
Contributor

@tomgi tomgi commented Nov 26, 2025

Context

During high-throughput spike periods, Que's job polling mechanism can lead to very high database load with continuous polling, even when the job buffer is already nearly full and workers are actively processing jobs.

What is possible to be happening currently:

  • locker accepts enough jobs via listen to fill the buffer
  • the jobs are super fast, so in the few milliseconds in between wait and next poll we have already worked a few
  • poller polls for a very few jobs to fill the buffer fully
  • locker accept more jobs via listen immediately (and potentially displaces any polled low-importance jobs)
  • workers work a few jobs again
  • the previous poll was satisfied?, so poller polls again immediately (potentially for the same low-importance jobs again)

Changes

Add optional skip-poll-when-buffer-above-threshold CLI parameter defaulting to 1.0.

When the buffer already has at least skip-poll-when-buffer-above-threshold fraction of its capacity filled, the polling is skipped for that iteration.

Backward-compatibility

Currently, the polling is skipped only when the buffer is completely full.

When the new skip-poll-when-buffer-above-threshold parameter is not provided, it defaults to 1.0 so there's no change compared to the current behaviour.

@tomgi tomgi marked this pull request as ready for review December 12, 2025 02:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant