Steve HutchinsonBig Pines

Consumer lag

The number of unprocessed messages between a consumer group's committed offset and the topic's latest offset. Rising lag indicates a consumer cannot keep pace with the producer and is the primary autoscaling signal for KEDA-managed workers.

Consumer lag is the most direct measure of whether a Kafka pipeline is keeping up with its input rate. It is computed per partition as the difference between the latest message offset and the last offset the consumer group has committed. When lag is zero, the consumer is processing messages as fast as they arrive. When lag grows, the consumer is falling behind - either because processing has become more expensive, resources are constrained, or the producer has spiked its output rate. In KEDA-managed deployments, consumer lag feeds directly into the autoscaling decision: a configured lag threshold triggers replica addition, and lag returning to baseline triggers scale-down. Persistent lag that does not respond to scaling often indicates a deeper bottleneck - partition count is too low, a single slow consumer holds the group back, or the processing logic itself needs optimization.

This site collects anonymous usage data to understand how people read and navigate the blog. Accepting enables persistent reader preferences across visits.