Skip to content
Get started
Get started
Queue Rate Limiting and Global Concurrency
guide · queue

A ceiling on how fast.

Third-party APIs have quotas and databases have limits. These caps live on the queue, so they hold no matter how many workers you start.

// Cap parallel processing across ALL workers on this queue
queue.setGlobalConcurrency(10);
queue.removeGlobalConcurrency();
await queue.setGlobalConcurrencyAsync(10); // same, but waits for the server
// Cap throughput: max jobs per window (default window: 1 second)
queue.setGlobalRateLimit(100); // max 100 jobs per second
queue.setGlobalRateLimit(100, 60_000); // max 100 jobs per minute
queue.removeGlobalRateLimit();
await queue.setGlobalRateLimitAsync(100, 60_000); // same, but waits for the server
// Temporary throttle to ~1 job/sec; the server clears it after 5s on its own
await queue.rateLimit(5000);

Global concurrency helpers exist in TypeScript, Python, and Elixir; the temporary rateLimit(ms) throttle is available in the Bun bunqueue package only.

See Rate Limiting for worker-side limiting too.

Queue APICreate a queue in embedded or TCP mode
Adding Jobsadd, addBulk, priorities, delays, durability
Deduplication and Idempotent Job AddsIdempotent adds, dedup keys, custom job ids
Querying JobsFetch jobs, states, counts and results
Queue Control and MaintenancePause, drain, obliterate, clean and repair
Progress, Job Logs and DependenciesProgress, per-job logs and dependencies
Job Schedulers from the QueueNamed repeatable schedules from the queue
DLQ Operations from the Queue ObjectFailed-job operations from the Queue object
Workers, Stats and Metrics from the QueueRegistered workers, stats and metrics windows
Namespaces, Auto-Batching and Store-and-ForwardNamespaces, auto-batching, store-and-forward
JobOptions ReferenceEvery JobOptions field, with defaults