Concurrency
Cap simultaneously-running jobs per task or per queue.
Cap simultaneously-running jobs per task or per queue.
maxConcurrent limits how many jobs of a task run at once across all workers —
enforced by the scheduler against the live running count, so it holds even with
many workers on shared storage.
queue.task("transcode", transcode, { maxConcurrent: 2 }); // never more than 2 at onceOver the limit, additional jobs stay pending and dispatch as running ones
finish.
Apply it to a whole queue:
queue.configureQueue("video", { maxConcurrent: 4 });Concurrency bounds simultaneous executions; rate
limiting bounds throughput over
time. They compose — a task can be both maxConcurrent: 2 and 100/min.
Coming from BullMQ? See the note on workers — BullMQ's
concurrencyoption scales with worker-process count; flexiq'smaxConcurrentis a single global cap the scheduler enforces no matter how many workers are running.