ZZomato·BehavioralL3System Design

Kafka Consumer Throughput and Lag Handling

viaGlassdoor

Q: How can Kafka consumer throughput be increased, and what happens when consumption lags behind production? A: To increase consumer throughput: add more consumer instances up to the number of partitions (each partition is consumed by at most one consumer within a group, so partition count caps parallelism), tune max.poll.records/fetch.min.bytes/fetch.max.wait.ms to batch more per poll, ensure per-record processing is fast or offload heavy work asynchronously, and consider increasing partition count if you're partition-bound. When consumption lags behind production (growing 'consumer lag'), the immediate risk is delayed processing and, if retention expires before the lagging consumer catches up, data loss (messages age out before being read). Mitigations include scaling out consumers, backpressure/alerting on lag metrics, and in the worst case seeking the consumer to a later offset (accepting some data loss) to catch up.

Add a follow-up question they asked
No follow-ups yet. Be the first to add one.
asked …
LeaderboardSalary
Language
Account