Producers send 20 percent more than the consumers can process. A teammate proposes making the queue ten times bigger. What do you say?
Sketch your own answer first, then compare it with the one below.
A strong answer
It will not raise throughput. The consumers still finish the same number of messages per second, so the excess is lost or held back as before, only later.
What changes is the wait. A full queue holds about its capacity and drains at a fixed rate, so ten times the buffer means roughly ten times the delay. Messages that have waited that long may no longer be useful.
Better proposals are more consumers, cheaper work, or shedding load at the edge. A bigger buffer is right in one case only: a burst longer than today's buffer, with average load below capacity.
Sources
- John D. C. Little (1961). A Proof for the Queuing Formula: L = λ W.
- Mor Harchol-Balter (2013). Performance Modeling and Design of Computer Systems.