Watch the queue's age, not just the errors
The last piece is knowing when something is wrong.
Queue age shows what errors and latency hide
| Hour | 1 | 2 | 3 | 4 | 5 | 6 |
|---|---|---|---|---|---|---|
| GPU utilization | 95% | 95% | 95% | 95% | 95% | 95% |
| error rate | 0.1% | 0.1% | 0.1% | 0.1% | 0.1% | 0.1% |
| oldest queued | 0.5 h | 1.4 h | 2.3 h | 3.2 h | 4.1 h | 5.0 h |
Error rate and GPU utilization can both look healthy while a batch service quietly misses its promise. Only the last row shows it.
Start where the Builders' Library does for queue-based systems: measure the age of the messages in the queue.
Backlogs are dangerous because draining one takes spare capacity you may not have. After an hour-long outage, recovering takes double the system's capacity for another hour.
Latency graphs can mislead too:
| 10 requests: 6 shed in 1 ms, 4 served in 5 s | Median | |
|---|---|---|
| all 10 | 1 ms | looks amazing |
| the 4 served | 5 s | what customers get |
Shed requests fail fast, and fast failures pull latency graphs down. The load-shedding article gives the example: a service shedding 60% of its traffic can show an amazing median latency while its successful requests are terribly slow. Graph successful-request latency on its own.
In the editor, write oldest_age(queued_at, now): the age of the oldest request still queued, 0 for an empty queue. Then write served_median(requests): the median latency of only the requests that were served. The print line is the 10-request table.