Unit content
Backpressure in network services
A network service cannot safely assume that downstream consumers always keep up. If producers continue generating data faster than a socket, peer or later processing stage can consume it, queues grow without bound.
Backpressure propagates limited capacity upstream. When an output buffer reaches a chosen bound, the service pauses or slows the source of new work rather than allocating unlimited memory.
For example, if a client stops reading while a server produces a large stream, the kernel send buffer eventually fills. The server should stop generating more data for that connection until the socket becomes writable again.
Backpressure differs from dropping: a system may choose to block, shed load, reject requests or discard low-value data depending on semantics.
The reusable principle is bounded flow: resource limits must influence producers, otherwise temporary slowness can become process-wide resource exhaustion.