Prompt

Kafka messages not being consumed fast enough, how do I troubleshoot this?

Technology / Data Infrastructure2 observationsLast seen Nov 15, 2026

Latest observation

Nov 15, 2026OpenAI APIWeb search: off

Here’s a practical way to troubleshoot Kafka consumers that are falling behind.

1) First identify where the lag is coming from

Check consumer lag by group, topic, and partition.

Useful commands:

kafka-consumer-groups.sh --bootstrap-server <broker:9092> \
  --describe --group <group-name>

Look for:

  • Large and growing lag on specific partitions
  • Uneven lag where only a few partitions are behind
  • One consumer instance owning too many partitions

If lag is only on some partitions, the problem may be key skew or hot partitions.


2) Check consumer health and throughput

Ask:

  • Is the consumer actually running continuously?
  • Is it restarting/crashing/rebalancing often?
  • Is it processing messages slower than they arrive?

Check app logs for:

  • Rebalance events
  • Commit failures
  • Deserialization errors
  • Timeouts
  • GC pauses / memory pressure
  • Retries or downstream dependency failures

If the consumer is healthy but slow, the bottleneck is usually:

  • message processing logic
  • downstream database/API
  • too little parallelism
  • fetch/commit settings
  • CPU/memory limits

3) Verify partition count vs consumer parallelism

Kafka parallelism is bounded by partition count.

Rules of thumb:

  • Max active consumers in a group = number of partitions
  • If you have 3 partitions and 10 consumers, only 3 are useful
  • If you have 100 partitions but 1 consumer, that consumer may be overwhelmed

Check:

  • Does the topic have enough partitions?
  • Is the consumer group scaled to match the partition count?

If needed:

  • Increase partitions for more parallelism
  • Scale consumer instances up to partition count

4) Look for uneven partition distribution

One slow partition can make lag look bad even if others are fine.

Causes:

  • Bad key choice causing hot partitions
  • One downstream record taking much longer than others
  • Large messages concentrated on one partition

Check partition lag individually and compare:

  • Record count per partition
  • Message size per partition
  • Processing time per partition

If key skew is the issue:

  • Use a better partitioning key
  • Salt hot keys
  • Revisit message distribution strategy

5) Measure processing time inside the consumer

Separate:

  • poll time
  • business logic time
  • commit time
  • retry time

If your consumer polls quickly but processes slowly, the issue is in your application logic.

Add metrics for:

  • time from poll() to completion
  • per-record processing latency
  • batch processing latency
  • external dependency latency
  • commit latency

This helps answer whether the bottleneck is Kafka or your code.


6) Check consumer configuration

Important configs that affect throughput:

Fetching

  • max.poll.records
    Increase if you want larger batches, but only if processing can keep up.
  • fetch.min.bytes / fetch.max.wait.ms
    Can help batch more data efficiently.

Session and polling

  • max.poll.interval.ms
    If processing takes too long, consumer may be kicked out of the group.
  • session.timeout.ms / heartbeat.interval.ms
    Too aggressive values can cause rebalances.

Offsets

  • enable.auto.commit=false for manual control
  • Commit in batches rather than after every message if safe

Deserialization

  • Expensive deserialization can limit throughput
  • Large payloads may cause memory pressure

If you increase max.poll.records, make sure processing and commit strategy can handle it.


7) Check downstream dependencies

Often Kafka is not the bottleneck. The consumer is waiting on:

  • database writes
  • external HTTP APIs
  • cache lookups
  • file I/O
  • rate limiting
  • lock contention

Signs:

  • High latency in one dependency
  • Retries/backoff increasing
  • Thread pool saturation
  • Connection pool exhaustion

Fixes:

  • batch writes
  • async I/O
  • caching
  • increase pool sizes carefully
  • circuit breakers / timeouts
  • isolate slow dependencies

8) Inspect broker-side metrics too

On the broker, check:

  • Under-replicated partitions
  • Request latency
  • Network saturation
  • Disk I/O saturation
  • CPU usage
  • Log flush / I/O wait

If brokers are overloaded, consumers may also appear slow because fetch requests are delayed.


9) Check for rebalances

Frequent rebalances can destroy throughput.

Common causes:

  • Consumers taking too long between polls
  • Crashes
  • Deployment rolling restarts
  • Static membership not enabled
  • Partition assignment churn

Symptoms:

  • lag rises in bursts
  • frequent “revoking partitions” logs
  • consumers temporarily stop processing

Mitigations:

  • reduce processing per poll
  • tune max.poll.interval.ms
  • use cooperative rebalancing
  • use static membership if appropriate

10) Validate resource limits

Consumer pods/hosts may be constrained by:

  • CPU limits
  • memory limits
  • GC pauses
  • disk throughput
  • network bandwidth

Check:

  • CPU throttling
  • memory OOMs
  • GC time
  • container restarts
  • thread starvation

If running in Kubernetes, look at:

  • CPU throttling metrics
  • memory requests/limits
  • pod restarts
  • node pressure

11) Common quick fixes

Depending on what you find, these often help:

  • Add more consumer instances
  • Increase topic partitions
  • Fix hot partitions / key skew
  • Batch processing instead of per-message work
  • Increase max.poll.records
  • Reduce downstream latency
  • Optimize serialization/deserialization
  • Increase DB connection pool or API throughput
  • Reduce rebalances
  • Use async processing carefully
  • Scale CPU/memory

12) A simple troubleshooting order

If you want a quick sequence:

  1. Check lag by partition
  2. Check consumer logs for rebalances/errors
  3. Measure processing time per message/batch
  4. Check downstream dependency latency
  5. Compare consumer count to partition count
  6. Inspect CPU/memory/GC
  7. Review Kafka consumer configs
  8. Check broker health

13) If you want, I can help you pinpoint it

If you share:

  • number of partitions
  • number of consumers
  • current lag
  • consumer config
  • processing pattern (per message or batch)
  • whether there’s a DB/API involved

…I can help you narrow down the likely bottleneck and suggest specific tuning changes.

Brands

Observation history

How did Obsurfable measure this prompt?

Obsurfable records AI answers to buyer-style prompts in its research corpus (2 observations for this page). Metrics are distributions over observations, not a single static ranking.

Which AI systems does Obsurfable collect answers from?

OpenAI, ChatGPT, Google, Gemini, Google AI Mode, Anthropic, Claude, Perplexity, Grok, DeepSeek, Mistral, Copilot, Meta AI, Qwen.

How can brands improve their AEO?

Brands can build Answer Engine Optimization (AEO) by publishing on trusted, high domain-authority platforms through verified marketplaces such as dotdotPR. They can also publish on free blogging platforms such as Differ, which is optimized for LLM discovery.

Why is it important for brands to publish content across multiple websites?

Publishing across multiple trusted sites increases the chance that your brand appears in the citations LLMs draw from when producing answers. Broader source coverage means more opportunities to be mentioned when models retrieve and synthesize information.

Want this interpreted for your brand?

Explorer is the free public corpus. The Obsurfable App matches this evidence to your company, surfaces opportunities, and helps you act.