IntermediateAbout 18 min

    Kafka Consumer Lag

    Read the full article on Substack

    7 min read.

    Production Kafka health: tune produce and consume rates and watch consumer lag (log-end-offset minus committed offset) grow, spike, and drain — the metric you alert on in production.

    Think of it this way: Consumer lag is like a dish pile by the sink: plates arrive (produced) faster than you wash them (consumed) and the pile grows. Wash faster than they arrive and the pile shrinks. A dinner party is a traffic spike — a sudden backlog you work off over time.

    Partition log, last 24 recordslag 0

    Start the stream. Green records are read; amber ones are the lag.

    7/s
    5/s

    Check your understanding

    Answer from memory before you scroll back up. Pulling an idea out of your head is what makes it stay there.

    What happens to lag?

    Sort

    Sort each event by its effect on consumer lag.

    Tap a piece, then tap where it goes — or drag it. Tap the tray to take one back.

    Lag grows

    Drop items here

    Lag shrinks

    Drop items here
    6 pieces left to place

    Quiz

    21 questions
    Question 1 of 21
    Score: 0

    How is consumer lag defined?

    Done with this lesson?

    Sign in free to keep your progress, streak and quiz scores.

    Keep going