# Backpressure reaches the producer

Principle `backpressure-reaches-the-producer`. Bounded consumption helps only when upstream respects waiting or refusal.

Also searched as: backpressure, bounded concurrency, overflow policy.

Asynchronous sends can outrun the receiver. Bound fan-out against scarce resources and make the producer participate in the flow-control policy.

Book basis: [B3](/bibliography#b3-designing-elixir-systems-with-otp), [B4](/bibliography#b4-release-it).

## Failure it prevents

A bounded consumer hides an ever-growing upstream mailbox or set of waiting producers.

## Our Effect 4.0.5 reading

Queue.bounded suspends offers at capacity. Queue.dropping and sliding choose loss policies. Bounded Effect.forEach and Semaphore cap active work, not every upstream backlog.

Source: `packages/effect/src/Queue.ts`, `packages/effect/src/Effect.ts`, `packages/effect/src/Semaphore.ts`.

## How to check

Run a faster producer against a slower consumer. Check backlog and memory, plus the documented wait, reject, or drop behavior. This is our proposed verification, not a quoted procedure.

Continue with [Admission control protects recovery](/principles/admission-controls-new-work), [Bulkheads isolate scarce capacity](/principles/bulkheads-isolate-capacity).

Connect this to [the existing rat-stack guidance](https://ratstack.sh/lore/concurrent-work-needs-an-owner).

Use [the durability skill](/skills/durability) for the full review. Return to [the durability index](/principles/durability).

## Skills
- [Durability starts with a recovery record](/principles/durability)

## Sources
- Gray II, James Edward; Tate, Bruce A. *Designing Elixir Systems with OTP*. Pragmatic Bookshelf, 2019. [Link](https://pragprog.com/titles/jgotp/designing-elixir-systems-with-otp/). ([b3-designing-elixir-systems-with-otp](/bibliography#b3-designing-elixir-systems-with-otp))
- Nygard, Michael T. *Release It!: Design and Deploy Production-Ready Software*. Pragmatic Bookshelf, 2007. [Link](https://archive.org/details/releaseitdesignd0000nyga). ([b4-release-it](/bibliography#b4-release-it))

## References
- [Effect contributors. Effect 4.0.5. Queue.ts](https://github.com/Effect-TS/effect/blob/7f524e25cfb49a71ac39b0f44278d08d40dda5de/packages/effect/src/Queue.ts). Pinned source for our Effect mapping, not a claim from the book.
- [Effect contributors. Effect 4.0.5. Effect.ts](https://github.com/Effect-TS/effect/blob/7f524e25cfb49a71ac39b0f44278d08d40dda5de/packages/effect/src/Effect.ts). Pinned source for our Effect mapping, not a claim from the book.
- [Effect contributors. Effect 4.0.5. Semaphore.ts](https://github.com/Effect-TS/effect/blob/7f524e25cfb49a71ac39b0f44278d08d40dda5de/packages/effect/src/Semaphore.ts). Pinned source for our Effect mapping, not a claim from the book.
