← Back to Node.js performance map
🚦
Node.js Performance

Backpressure

Protect Node from accepting more work than it can finish.

safety

Detailed Description

Backpressure prevents a Node service from accepting unlimited work. Without it, queues grow, memory rises, downstream systems overload, and requests eventually timeout.

Use concurrency limits, bounded queues, rate limits, and 429/503 responses. A controlled rejection is much healthier than letting the whole process collapse.

Mental Model

queue depth high
-> reject/rate-limit
-> recover before timeout storm

When To Use

  • ->Downstream DB or API saturates
  • ->Workers keep timing out
  • ->Queues grow without bound
Tools: Bottleneck, p-limit, BullMQ concurrency, HTTP 429
backpressure.js

Live Editor

Loading...

Output

Run code to see output...