ARRIVE · QUEUE · PROCESS
Backpressure: account for every record
Integer records, explicit policies and sixty seconds of inspectable history.
AICASSINDRA · DECISION MISSION
The Vanishing Queue: Where Did the Work Go?
An empty queue can look healthy even when many offers were dropped or deferred. At 60 simulated seconds, keep peak queue size at most 80, omit no offered work, and drain the accepted queue. Can all three goals hold at your selected source rate?
Evidence: deterministic teaching simulation. Predict a result, compare the alternatives, then explain which constraint mattered. No model API or real infrastructure is contacted.
Run the mission to inspect a deterministic comparison.
Need a hint?
A queue that stops growing has not necessarily completed every offer. Count processed, queued, discarded and deferred work separately. Lowering the source rate changes how much work was offered; it is not a same-throughput optimization.
Model assumptions and research reference
The original deterministic queue engine runs in 100 ms steps. Service is 40 records/s before 30 seconds and 160 records/s afterward. Capacity is 80 except for the unbounded policy. Deferred offers are not accepted and are not retried automatically. The source rate remains an offered-work rate, so this is not a conforming Reactive Streams implementation. Admission happens before service in each step; even matched average rates need a small transient buffer.
Reactive Streams: bounded asynchronous backpressure. The mission and its numerical targets are original teaching designs.
Explain the surprise: which result looked better until you counted the missing cost? Change one input and find a counterexample to your first conclusion.
Exact record and counter evidence
Follow records through a bounded or unbounded queue
Backpressure is a response to demand exceeding service capacity, not a color on a buffer bar. This experiment tracks each offered record through admission, processing, dropping or an unrealized backpressured offer. Compare policies while keeping rates fixed. Record identities reveal whether overload preserves older work or replaces it with newer work; the accounting makes silent loss visible. The queue is local fictional state and does not connect to a broker or a real producer.
Set arrival and service rates
Producer rate is offered records per modeled second. Initial consumer capacity applies before Recovery starts at; Recovery capacity applies from that boundary onward. Set all three rates independently between zero and two hundred. Recovery starts at accepts zero through sixty seconds: zero uses recovery capacity from the beginning, while sixty keeps the initial rate throughout this run. Changing an input rebuilds the same deterministic sixty-second experiment and pauses at its start. Rates describe available processing capacity; an empty queue cannot consume unused capacity or save it for later.
Choose the capacity and overload policy
Buffer capacity limits admitted waiting records from one to five hundred. Block counts an offer made while full as backpressured: no record is emitted for that opportunity. This is source throttling, not a hidden upstream retry queue, and those opportunities are not replayed later. Drop newest discards the new offer when full. Drop oldest evicts the oldest waiting record and admits the new one. Unbounded admits every offer and ignores the capacity limit. It retains its real queue length, although the diagram shows only a sample. The finite simulation does not allocate memory forever or predict a specific out-of-memory event.
Compare preservation against freshness
Set producer to one hundred, both consumer capacities to zero, and buffer capacity to ten. Show the final state with Drop newest: records one through ten remain and later offers are dropped. Switch to Drop oldest: the retained records are five thousand nine hundred ninety-one through six thousand. Switch to Block: the initial ten records remain and later opportunities are backpressured, not counted as admitted or lost emitted records. Unbounded retains all six thousand records. This comparison separates the age of surviving data from raw queue length.
Check conservation and recovery
At every snapshot, offered equals processed plus queued plus dropped-new plus evicted-old plus backpressured offers. Admitted equals processed plus queued plus evicted-old. Return to defaults and observe the bounded queue fill before the consumer capacity rises at thirty seconds. The recovery phase drains admitted work, but cannot recover records already dropped or opportunities never emitted. Admissions happen before service within each step, so even a faster consumer can encounter transient capacity pressure with a very small buffer. This discrete ordering is explicit rather than a continuous-fluid approximation.
Inspect the timeline and actual record identities
Play advances the modeled time over sixty viewing seconds at normal speed. Pause freezes it, Next second advances one second, Restart rewinds the same scenario, and Show final state jumps to sixty seconds. Speed offers half, normal and double pace; Inspect time scrubs forward and backward. Restore defaults resets all scenario inputs. The buffer displays the first twenty-four queued record identifiers with the oldest at top left. The full queued count is never trimmed to fit the picture. Exact evidence reports the current oldest, newest, last consumed, counters and offsets. The graph shows history only up to the inspected time.
Understand the event ordering
The engine advances in one hundred millisecond steps. It admits that step’s arrivals before applying its consumer budget. Integer counts come from differences of cumulative rate budgets, so seven records per second really produces four hundred twenty records over this minute rather than rounding every frame. The recovery phase starts a new service budget. Record ages and counts are modeled values, not measured network latency or wall-clock throughput. Changing playback speed changes inspection pace without changing the computed trace.
Recognize what the queue does not model
There is one FIFO queue and one aggregate consumer capacity. No acknowledgements, retries, partition assignment, disk writes, variable message size, priority or consumer crash is included. A source that must retain every rejected offer requires a separate upstream state and retry model; this lab does not silently claim to supply it. Oldest age is elapsed modeled queue residence, not end-to-end latency. All inputs and outputs remain in your browser.