Services

Resources

Company

/

Backpressure

Backpressure

Backpressure is the way a system pushes resistance back to a producer when a downstream consumer cannot keep up. Instead of buffering without limit, the consumer slows, blocks or rejects the producer. The rate of the whole pipeline then matches its slowest stage, and memory stays bounded. Without it, queues grow until something crashes or drops data.

How it works

Each stage uses a bounded buffer. When the buffer is full, the stage signals upstream. TCP does this with its receive window, a reactive stream with request(n), an HTTP service with a 429 or 503 response, and a blocking queue by making put wait. For example, a producer sends 5,000 events per second to a consumer that handles 4,000. The surplus is 1,000 per second, so a 100,000 item buffer fills in 100 seconds. After that the producer must slow to 4,000 per second.

Why it matters in production

A missing backpressure path turns a slow dependency into an out-of-memory crash, often far from the real bottleneck. With backpressure, overload shows up as rising latency or rejected requests at the edge, which you can see and alert on. Pair it with rate limiting and retry budgets.

See also

On the One2N blog

Further reading

Backpressure drawn as a tank: a producer sends 5,000 events a second into a bounded buffer of 100,000 items, and a consumer drains it at 4,000 a second. A green arrow from the buffer back to the producer reads full: slow to 4,000 a second. Below, 5,000 − 4,000 = 1,000 a second extra, and 100,000 ÷ 1,000 = full in 100 seconds. Red dashed walls above the lid mark a buffer with no limit: out of memory.

Putting this into practice?

Talk to One2N about our backend engineering services

Talk to One2N about our backend engineering services