Automattic / Automattic/kue

Delayed jobs in queue

Open
#524 4 comments 0 reactions 0 assignees View on GitHub
need more info Question
Dominant language
JavaScript
Stars
9.4k
Forks
858
PR merge metrics
No merged PRs in 30d

Description

Hi there,

We just implemented Kue as a replacement for a custom rolled solution from another developer and so far we're really enjoying the rich features (and the gorgeous GUI).

I believe this is more of a question than an actual issue, however we're noticing a delay from when a queued job is created (in Inactive state) through to it being processed (Active state). The delay is variable, sometimes starting immediately and sometimes taking up to 10-20 seconds.

This happens consistently, no matter if there are no jobs or thousands of jobs.

We're using a cluster implementation that forks 4 threads, each thread is connecting to Redis and our Postgres db. If try the implementation without cluster we see the same delays.

Two thoughts come to mind:
1. There's something holding back delegating jobs from inactive -> active. Without knowing how Kue is implemented, this is proving difficult to quickly debug.
2. The jobs that are effected seem to be lower priority jobs. We assumed that the priority level doesn't apply any delay to the delegation of a task, if this isn't so is there any documentation to clarify that? If there are no jobs in the queue, the assumption is that that it would instantly move to being processed.

Any insight would be extremely helpful.

Thanks and keep up the great work on this package.

Contributor guide

No contributing guide indexed for this repository

Research direction

No files or tests are named. Start by reproducing the inactive-to-active delay with and without cluster workers, while comparing priority levels and Redis/Postgres configurations. Done means identifying whether polling, delegation, or priority handling causes the delay and clarifying the expected behavior in the project documentation.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript, node.js, postgresql, redis
Domain
backend, distributed-systems
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
20/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.