Skip to content

Add BetterQueue to the list - #275

Closed
Saiop68 wants to merge 1 commit into
breejs:masterfrom
Saiop68:add/better-queue
Closed

Saiop68 wants to merge 1 commit into
breejs:masterfrom
Saiop68:add/better-queue

Conversation

@Saiop68

@Saiop68 Saiop68 commented Oct 30, 2026

Copy link
Copy Markdown

Adds BetterQueue, a distributed rate limiter and job queue for Node.js.

The queue state lives in Redis rather than in the process, which changes three practical things:

  • A limiter is a thin handle. Creating 1000 limiters costs roughly what 10 do, because the per-limiter state is not held in the process.
  • Jobs survive a crash. A job held by a worker that dies is re-queued and picked up by another process instead of being lost.
  • Priority ordering is global. Ordering is computed server-side in Redis, so a high-priority job outranks a lower-priority one in any process, not just within one limiter.

It also supports scheduleAt() for work that needs to run later, which Bottleneck does not.

The repository includes a benchmark that runs both libraries in separate processes against the same Redis. With 1000 limiters and 51,000 jobs:

Metric Bottleneck 2.19.5 BetterQueue
RSS after the run 415 MB 222 MB
Heap after forced GC 14 MB 11 MB
Throughput 9,957 jobs/s 11,456 jobs/s

MIT licensed, written in TypeScript, 37 tests with CI running on Node 18/20/22.

@Saiop68 Saiop68 closed this Nov 9, 2026
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