Consumer Autoscaling - Junior¶
Consumer CPU can be low while millions of events wait, especially when each event blocks on I/O. Lag measures records not yet processed.
flowchart LR
Spike[Traffic spike] --> Backlog[Kafka lag grows]
CPU[Consumer CPU remains moderate] -.misses.-> Backlog
More consumers increase throughput only until every partition has an active consumer. Scale decisions should target backlog drain time, not zero lag at any cost. Test yourself¶
- Why can CPU hide a backlog?
- What limits useful consumer count?
- Why is lag age useful? Continue to
middle.md.