AlgoViz

Queue backlog, poison messages and safe redrive

medium 6 min

Queue depth counts outstanding messages, while oldest age tells you how long some work has waited.

Video lesson · Chapter 1 of 4

A queue grows even after traffic normalizes

0:00 / 2:32

Theory

Read or listen first. About 1 min.

What it is

Queue depth counts outstanding messages, while oldest age tells you how long some work has waited. In a simple steady interval, backlog shrinks only if successful completions exceed incoming work. Retries consume capacity and may deliver an operation more than once. A redrive must preserve the logical operation’s identity.

Why it exists

A consumer repeatedly fails one malformed message. If arrivals are 80 jobs/s and successful capacity is 100 jobs/s, draining 2400 eligible jobs takes about two minutes at a net 20/s. That estimate fails when retries or ordering block useful completions. Isolate repeat failures, repair the consumer and replay a bounded sample while checking for duplicate effects.

If eligible backlog falls while oldest age grows, examine stranded groups or repeat failures rather than scaling all consumers.

A queue grows even after traffic normalizes

Producer → Work queue (enqueue job). Work queue → Consumer pool (deliver job). Consumer pool → Work queue (acknowledge success)
Producer → Work queue (enqueue job). Work queue → Consumer pool (deliver job). Consumer pool → Work queue (acknowledge success)

How it works

Step through the idea, or press Play.

Step 1 of 3

Baseline. The oldest eligible job waits one minute.

Understand it

Worked incident

A queue grows even after traffic normalizes

ObservationOldest pending age (min)Interpretation
Baseline1The oldest eligible job waits one minute.
Incident24Retries consume worker slots and age reaches 24 minutes.
After intervention3Quarantine the failing input, validate idempotent handling and redrive gradually while age falls.
Illustrative measurements from the same workload at three checkpoints.

Choose the next investigation

If eligible backlog falls while oldest age grows, examine stranded groups or repeat failures rather than scaling all consumers.

Summary

The whole topic in one minute.

Arrivals and failed attempts both matter. Only net successful drain reduces the waiting work.

If eligible backlog falls while oldest age grows, examine stranded groups or repeat failures rather than scaling all consumers.

Sources