Automattic / Automattic/kue

Job Grouping and Max Jobs

Open
#493 5 comments 0 reactions 0 assignees View on GitHub
Discussion
Dominant language
JavaScript
Stars
9.4k
Forks
858
PR merge metrics
No merged PRs in 30d

Description

We process lots of jobs on 6 nodes. These jobs currently only run one at a time. The queue fills up and the jobs wait, however lets say I have 30 of "job-A" queued, my workers are fully loaded and will wait, as expected, to finish the current job before starting another. My problem begins when, lets say, 20 of "job-B" gets queue, then 20 of "job-C" gets queued. Now the workers are running 3 tasks at a time, for a relatively long duration of time. Eventually we start running out of memory, as there are 8 different jobs that can run. Now to reduce the occurrence of this problem, each of these jobs is limited to a concurrency of 1. However, each being set to a concurrency of 1 means that 8 jobs can run at a time, just not the same job.

What I'd like to be able to do is some how group these jobs up based on what kind of resources they use(processing, io, etc), and limit the concurrency of that group. Though a global limit would likely work as well, I feel that having the ability to group jobs up would make a lot of sense and could prove to be a vital feature.

Contributor guide

No contributing guide indexed for this repository

Research direction

No files, tests, or entry points are named. Start by reviewing the worker concurrency and queue scheduling behavior; done would mean supporting resource-based job groups with concurrency limits, or a clearly defined global limit, so queued jobs do not exhaust memory.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript, node.js, redis
Domain
backend, distributed-systems
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.