DOCUMENTRUNBOOK · ON-CALL

Runbook — order events lagging

Diagnose and clear a backlog on the OrderPlaced consumer.

SECTION 01 · Note

When to use this

Warning
Use when the OrderPlaced consumer lag alarm fires (lag > 5 min) or downstreams report stale orders.

Procedure

SECTION 02 · Flowchart

Triage the lag

FLOW
FlowchartLag alarmDLQ filling?Inspect + replay DLQCPU pinned?Scale consumers upEscalate to owningsquadLag clears1234
1yes2no3yes4no

Commands

SECTION 03 · Code
Check consumer lagbash
aws cloudwatch get-metric-statistics --namespace Orders \
  --metric-name ConsumerLag --period 60 --statistics Maximum
Scale the consumer servicebash
aws ecs update-service --cluster orders --service event-worker --desired-count 6

Symptom → action

SECTION 04 · Comparison
SymptomLikely causeAction
DLQ growingPoison messageInspect, fix or skip, then replay the DLQ
CPU pinnedUnder-provisionedScale consumers up; right-size after
No throughputBus outageEscalate to platform on-call