The only agent that thinks for itself

Autonomous Monitoring with self-learning AI built-in, operating independently across your entire stack.

Unlimited Metrics & Logs
Machine learning & MCP
5% CPU, 150MB RAM
3GB disk, >1 year retention
800+ integrations, zero config
Dashboards, alerts out of the box
> Discover Netdata Agents

Centralized metrics streaming and storage

Aggregate metrics from multiple agents into centralized Parent nodes for unified monitoring across your infrastructure.

Stream from unlimited agents
Long-term data retention
High availability clustering
Data replication & backup
Scalable architecture
Enterprise-grade security
> Learn about Parents

Fully managed cloud platform

Access your monitoring data from anywhere with our SaaS platform. No infrastructure to manage, automatic updates, and global availability.

Zero infrastructure management
99.9% uptime SLA
Global data centers
Automatic updates & patches
Enterprise SSO & RBAC
SOC2 & ISO certified
> Explore Netdata Cloud

Deploy Netdata Cloud in your infrastructure

Run the full Netdata Cloud platform on-premises for complete data sovereignty and compliance with your security policies.

Complete data sovereignty
Air-gapped deployment
Custom compliance controls
Private network integration
Dedicated support team
Kubernetes & Docker support
> Learn about Cloud On-Premises

Powerful, intuitive monitoring interface

Modern, responsive UI built for real-time troubleshooting with customizable dashboards and advanced visualization capabilities.

Real-time chart updates
Customizable dashboards
Dark & light themes
Advanced filtering & search
Responsive on all devices
Collaboration features
> Explore Netdata UI

Monitor on the go

Native iOS and Android apps bring full monitoring capabilities to your mobile device with real-time alerts and notifications.

iOS & Android apps
Push notifications
Touch-optimized interface
Offline data access
Biometric authentication
Widget support
> Download apps

The future of infrastructure observability

See our strategic direction across AI-native observability, full-stack signals, operational intelligence, and enterprise platform maturity.

AI-native observability
Full-stack signal coverage
Operational intelligence
Enterprise platform maturity
Agent releases every 6 weeks
Cloud continuous delivery
> Explore Product Roadmap

Best energy efficiency

True real-time per-second

100% automated zero config

Centralized observability

Multi-year retention

High availability built-in

Zero maintenance

Always up-to-date

Enterprise security

Complete data control

Air-gap ready

Compliance certified

Millisecond responsiveness

Infinite zoom & pan

Works on any device

Native performance

Instant alerts

Monitor anywhere

AI-native observability

Continuous delivery

Open source foundation

80% Faster Incident Resolution

AI-powered troubleshooting from detection, to root cause and blast radius identification, to reporting.

True Real-Time and Simple, even at Scale

Linearly and infinitely scalable full-stack observability, that can be deployed even mid-crisis.

90% Cost Reduction, Full Fidelity

Instead of centralizing the data, Netdata distributes the code, eliminating pipelines and complexity.

See and Map Your Entire Network

Live topology, flow analytics, and SNMP device and trap monitoring — unified with your full-stack observability.

Control Without Surrender

SOC 2 Type 2 certified with every metric kept on your infrastructure.

Integrations

800+ collectors and notification channels, auto-discovered and ready out of the box.

800+ data collectors
Auto-discovery & zero config
Cloud, infra, app protocols
Notifications out of the box
> Explore integrations
Real Results
46% Cost Reduction

Reduced monitoring costs by 46% while cutting staff overhead by 67%.

— Leonardo Antunez, Codyas

Zero Pipeline

No data shipping. No central storage costs. Query at the edge.

From Our Users
"Out-of-the-Box"

So many out-of-the-box features! I mostly don't have to develop anything.

— Simon Beginn, LANCOM Systems

No Query Language

Point-and-click troubleshooting. No PromQL, no LogQL, no learning curve.

Enterprise Ready
67% Less Staff, 46% Cost Cut

Enterprise efficiency without enterprise complexity—real ROI from day one.

— Leonardo Antunez, Codyas

SOC 2 Type 2 Certified

Zero data egress. Only metadata reaches the cloud. Your metrics stay on your infrastructure.

Full Coverage
800+ Collectors

Auto-discovered and configured. No manual setup required.

Any Notification Channel

Slack, PagerDuty, Teams, email, webhooks—all built-in.

Built for the People Who Get Paged

Because 3am alerts deserve instant answers, not hour-long hunts.

Every Industry Has Rules. We Master Them.

See how healthcare, finance, and government teams cut monitoring costs 90% while staying audit-ready.

Monitor Any Technology. Configure Nothing.

Install the agent. It already knows your stack.
From Our Users
"A Rare Unicorn"

Netdata gives more than you invest in it. A rare unicorn that obeys the Pareto rule.

— Eduard Porquet Mateu, TMB Barcelona

99% Downtime Reduction

Reduced website downtime by 99% and cloud bill by 30% using Netdata alerts.

— Falkland Islands Government

Real Savings
30% Cloud Cost Reduction

Optimized resource allocation based on Netdata alerts cut cloud spending by 30%.

— Falkland Islands Government

46% Cost Cut

Reduced monitoring staff by 67% while cutting operational costs by 46%.

— Codyas

Real Coverage
"Plugin for Everything"

Netdata has agent capacity or a plugin for everything, including Windows and Kubernetes.

— Eduard Porquet Mateu, TMB Barcelona

"Out-of-the-Box"

So many out-of-the-box features! I mostly don't have to develop anything.

— Simon Beginn, LANCOM Systems

Real Speed
Troubleshooting in 30 Seconds

From 2-3 minutes to 30 seconds—instant visibility into any node issue.

— Matthew Artist, Nodecraft

20% Downtime Reduction

20% less downtime and 40% budget optimization from out-of-the-box monitoring.

— Simon Beginn, LANCOM Systems

Pay per Node. Unlimited Everything Else.

One price per node. Unlimited metrics, logs, users, and retention. No per-GB surprises.

Free tier—forever
No metric limits or caps
Retention you control
Cancel anytime
> See pricing plans

What's Your Monitoring Really Costing You?

Most teams overpay by 40-60%. Let's find out why.

Expose hidden metric charges
Calculate tool consolidation
Customers report 30-67% savings
Results in under 60 seconds
> See what you're really paying

Your Infrastructure Is Unique. Let's Talk.

Because monitoring 10 nodes is different from monitoring 10,000.

On-prem & air-gapped deployment
Volume pricing & agreements
Architecture review for your scale
Compliance & security support
> Start a conversation

Monitoring That Sells Itself

Deploy in minutes. Impress clients in hours. Earn recurring revenue for years.

30-second live demos close deals
Zero config = zero support burden
Competitive margins & deal protection
Response in 48 hours
> Apply to partner

Per-Second Metrics at Homelab Prices

Same engine, same dashboards, same ML. Just priced for tinkerers.

Community: Free forever · 5 nodes · non-commercial
Homelab: $90/yr · unlimited nodes · fair usage
> Get the Homelab Plan

$1,000 Per Referral. Unlimited Referrals.

Your colleagues get 10% off. You get 10% commission. Everyone wins.

10% of subscriptions, up to $1,000 each
Track earnings inside Netdata Cloud
PayPal/Venmo payouts in 3-4 weeks
No caps, no complexity
> Get your referral link
Cost Proof
40% Budget Optimization

"Netdata's significant positive impact" — LANCOM Systems

Calculate Your Savings

Compare vs Datadog, Grafana, Dynatrace

Savings Proof
46% Cost Reduction

"Cut costs by 46%, staff by 67%" — Codyas

30% Cloud Bill Savings

"Reduced cloud bill by 30%" — Falkland Islands Gov

Enterprise Proof
"Better Than Combined Alternatives"

"Better observability with Netdata than combining other tools." — TMB Barcelona

Real Engineers, <24h Response

DPA, SLAs, on-prem, volume pricing

Why Partners Win
Demo Live Infrastructure

One command, 30 seconds, real data—no sandbox needed

Zero Tickets, High Margins

Auto-config + per-node pricing = predictable profit

Homelab Ready
Free Video Course

8-episode Netdata tutorial by LearnLinux.tv

76k+ GitHub Stars

3rd most starred monitoring project

Worth Recommending
Product That Delivers

Customers report 40-67% cost cuts, 99% downtime reduction

Zero Risk to Your Rep

Free tier lets them try before they buy

AI Support Assistant, Available 24/7

Nedi has access to all official documentation, source code, and resources. Ask any question about Netdata—responds in your language.

Deployment & configuration
Troubleshooting & sizing
Alerts & notifications
Evidence-based answers
> Ask Nedi now

Never Fight Fires Alone

Docs, community, and expert help—pick your path to resolution.

Learn.netdata.cloud docs
Discord, Forums, GitHub
Premium support available
> Get answers now

60 Seconds to First Dashboard

One command to install. Zero config. 850+ integrations documented.

Linux, Windows, K8s, Docker
Auto-discovers your stack
> Read our documentation

76,000+ Engineers Strong

615+ contributors. 1.5M daily downloads. One mission: simplify observability.

Per-Second. 90% Cheaper. Data Stays Home.

Side-by-side comparisons: costs, real-time granularity, and data sovereignty for every major tool.

See why teams switch from Datadog, Prometheus, Grafana, and more.

> Browse all comparisons
Edge-Native Observability, Born Open Source
Per-second visibility, ML on every metric, and data that never leaves your infrastructure.
Founded in 2016
615+ contributors worldwide
Remote-first, engineering-driven
Open source first
> Read our story
Promises We Publish—and Prove
12 principles backed by open code, independent validation, and measurable outcomes.
Open source, peer-reviewed
Zero config, instant value
Data sovereignty by design
Aligned pricing, no surprises
> See all 12 principles
Edge-Native, AI-Ready, 100% Open
76k+ stars. Full ML, AI, and automation—GPLv3+, not premium add-ons.
76,000+ GitHub stars
GPLv3+ licensed forever
ML on every metric, included
Zero vendor lock-in
> Explore our open source
Build Real-Time Observability for the World
Remote-first team shipping per-second monitoring with ML on every metric.
Remote-first, fully distributed
Open source (76k+ stars)
Challenging technical problems
Your code on millions of systems
> See open roles
Meet the Team Behind Netdata
Conferences, meetups, and tradeshows where you can see Netdata in action and talk to the engineers who build it.
Live demos and deep dives
Book 1-on-1 meetings
Talks and panel sessions
Event recaps and photos
> See all events
Talk to a Netdata Human in <24 Hours
Sales, partnerships, press, or professional services—real engineers, fast answers.
Discuss your observability needs
Pricing and volume discounts
Partnership opportunities
Media and press inquiries
> Book a conversation
Your Data. Your Rules.
On-prem data, cloud control plane, transparent terms.
Trust & Scale
76,000+ GitHub Stars

One of the most popular open-source monitoring projects

SOC 2 Type 2 Certified

Enterprise-grade security and compliance

Data Sovereignty

Your metrics stay on your infrastructure

Validated
University of Amsterdam

"Most energy-efficient monitoring solution" — ICSOC 2023, peer-reviewed

ADASTEC (Autonomous Driving)

"Doesn't miss alerts—mission-critical trust for safety software"

Community Stats
615+ Contributors

Global community improving monitoring for everyone

1.5M+ Downloads/Day

Trusted by teams worldwide

GPLv3+ Licensed

Free forever, fully open source agent

Why Join?
Remote-First

Work from anywhere, async-friendly culture

Impact at Scale

Your work helps millions of systems

Monitoring

Apache Kafka Consumer Lag: Troubleshooting & Fixes

A deep dive into the causes of consumer lag- how to monitor it- and how to tune your Kafka consumers for optimal performance
by Netdata Team · July 23, 2025

You’ve built a powerful, real-time data pipeline with Apache Kafka, but suddenly, things grind to a halt. The dreaded consumer lag is exploding, alerts are firing, and your downstream applications are starved for data. This scenario is all too common for teams running Kafka at scale. Often, the culprit is a subtle interplay between consumer group rebalancing, partition assignment, and suboptimal consumer configurations. Understanding these mechanics is not just about fixing a problem; it’s about building resilient, high-throughput streaming systems from the ground up.

Tackling Kafka consumer lag requires a proactive approach. Instead of reacting to lag spikes, you need to monitor the right metrics, comprehend the rebalancing process, and fine-tune your consumers for peak performance. This guide will walk you through the complexities of consumer group coordination, explain why rebalances happen, and provide actionable strategies to optimize throughput and maintain stability in your Kafka ecosystem.

Understanding the Consumer Group Rebalance

At the heart of Kafka’s parallelism and fault tolerance is the consumer group. When multiple consumer instances subscribe to the same topics under a single group.id, Kafka distributes the topic partitions among them. This distribution ensures that each partition is consumed by exactly one consumer in the group, allowing for parallel processing. The process of assigning or re-assigning partitions to consumers is called a rebalance.

A rebalance is triggered by the Group Coordinator, a designated broker responsible for managing the state of a consumer group. A rebalance is initiated under several conditions:

  • A new consumer joins the group.
  • An existing consumer leaves the group (either gracefully by calling unsubscribe() or ungracefully by crashing or timing out).
  • The topic metadata changes, such as when new partitions are added to a subscribed topic.

While rebalancing is a powerful feature for elasticity and fault tolerance, it has a significant side effect: it causes a “stop-the-world” pause for the entire consumer group. During a rebalance, consumers cannot fetch or process any messages. This pause is necessary to ensure partition assignments are consistent across all members before consumption resumes. If rebalances are frequent or take a long time, they become a primary source of consumer lag.

The Rebalance Protocol and its Impact

The rebalance process involves several steps coordinated between the consumers and the Group Coordinator:

  1. Trigger: An event (like a consumer joining or leaving) triggers the rebalance. The Group Coordinator revokes ownership of all partitions from all consumers in the group.
  2. Rejoin: All consumers must send a JoinGroup request to the coordinator to rejoin the group.
  3. Assignment: The first consumer to join is designated the group leader. The leader receives a list of all members and is responsible for running a PartitionAssignor strategy to decide which partitions go to which consumer.
  4. Sync: The leader sends the assignment plan to the Group Coordinator. The coordinator then distributes the specific partition assignments to each respective consumer in a SyncGroup response.
  5. Resume: Consumers receive their new partition assignments and can resume fetching messages.

This entire process can be time-consuming. The longer it takes for all consumers to rejoin, for the leader to calculate assignments, and for everyone to sync up, the longer the consumption pause, and the more lag accumulates. Frequent, short rebalances can be just as damaging as infrequent, long ones.

Why Consumer Lag Explodes and How to Monitor It

Consumer lag is the difference between the latest offset produced to a partition and the last offset committed by a consumer for that partition. A small, stable lag is normal, representing the in-flight messages being processed. However, a “lag explosion” refers to a rapid, uncontrolled increase in this offset difference, indicating that consumers cannot keep up with producers.

Key Causes of Consumer Lag Spikes

  • Frequent Rebalancing: As discussed, every rebalance pauses consumption. If consumers are unstable and frequently join/leave the group, the cumulative pause time can cause lag to build up rapidly.
  • Slow Processing: The consumer application itself might be the bottleneck. If processing a single message takes too long, the consumer won’t call poll() frequently enough, leading to lag. This can be due to slow database calls, complex computations, or waiting on external services.
  • Insufficient Throughput: The consumer may not be configured to fetch data fast enough from the brokers, even if its processing logic is fast. This is often a matter of tuning consumer fetch configurations.
  • Partition Skew: Data may not be evenly distributed across partitions. If a few partitions receive a disproportionately high volume of messages, the consumers assigned to those partitions will struggle to keep up, creating lag on those specific partitions while others are fine.
  • Broker or Network Issues: Problems on the broker side, like high disk I/O or network saturation, can slow down fetch responses, contributing to consumer lag.

Essential Metrics for Monitoring Consumer Lag

Proactively monitoring lag is crucial. Relying on end-user complaints is a recipe for disaster. You should monitor key JMX metrics provided by Kafka clients and brokers.

  • records-lag-max: This is the most critical metric. It shows the maximum lag in the number of records for any partition assigned to a consumer. An increasing value over time is a clear sign that the consumer group is falling behind.
  • fetch-rate: The number of fetch requests per second. A low fetch rate might indicate that the consumer is spending too much time processing messages between poll() calls.
  • bytes-consumed-rate: The average number of bytes consumed per second. This helps you understand the consumer’s actual throughput.
  • Consumer Group Rebalance Metrics:
    • join-rate: The rate of consumers joining the group. A high join rate signals instability.
    • sync-rate: The rate of consumers syncing their assignments. A high rate corresponds to frequent rebalances.
    • rebalance-latency-avg / rebalance-latency-max: The average and maximum time spent in a rebalance. High values here point directly to prolonged consumption pauses.

Tools like Netdata can automatically collect these metrics, provide real-time dashboards, and set up alerts for anomalies like a sudden increase in records-lag-max or rebalance-latency-max, allowing you to detect and diagnose lag explosions before they impact your services.

Throughput Optimization and Rebalance Tuning

To prevent consumer lag, you need to minimize rebalance duration and maximize message consumption throughput. This is achieved by carefully tuning consumer configuration parameters. All the following parameters are set on the consumer client.

Stabilizing the Consumer Group

The first step is to ensure your consumer group is stable. Unnecessary rebalances are often caused by misconfigured timeouts.

  • session.timeout.ms: This property defines the maximum time a consumer can be out of contact with the Group Coordinator before being considered dead. If the consumer doesn’t send a heartbeat within this window, the coordinator will kick it out of the group, triggering a rebalance.
  • heartbeat.interval.ms: This dictates how frequently the consumer sends a heartbeat to the coordinator. It must be lower than session.timeout.ms, and it’s recommended to be no more than one-third of the session timeout.
  • max.poll.interval.ms: This is a crucial setting that defines the maximum amount of time allowed between calls to consumer.poll(). If your message processing takes longer than this value, the consumer will stop sending heartbeats, and the coordinator will assume it has failed, leading to a rebalance. If your processing logic is slow, you must increase this value.

Imagine your application takes, on average, 1 minute to process a batch of records. With the default max.poll.interval.ms of 5 minutes, you are safe. But if a particular batch requires complex processing and takes 6 minutes, the consumer will miss its deadline. The Group Coordinator will remove it, triggering a rebalance, pausing all other consumers, and causing lag to spike across the group. The fix is to increase max.poll.interval.ms to a value that safely accommodates your longest processing time.

Optimizing Consumer Throughput

Once your group is stable, you can focus on pulling data from Kafka as efficiently as possible. This involves tuning how the consumer fetches batches of records.

  • max.poll.records: This controls the maximum number of records returned in a single call to poll(). If your processing is fast, you can increase this to process more records per poll loop, improving throughput.
  • fetch.min.bytes: This sets the minimum amount of data the broker should return for a fetch request. If the broker has fewer than this many bytes, it will wait up to fetch.max.wait.ms for more data to arrive. Setting this to a higher value reduces the number of requests to the broker, which can lower broker CPU usage and improve overall throughput at the cost of slightly higher latency.
  • fetch.max.bytes: This is the maximum amount of data the server will return for a fetch request. It’s an upper bound on the size of the data received in one go.
  • fetch.max.wait.ms: The maximum time the server will block waiting for fetch.min.bytes of data to be available.

The goal is to make fewer, larger fetch requests. This is more efficient for both the consumer and the broker. You should increase fetch.min.bytes to encourage the broker to send fuller batches, adjust fetch.max.wait.ms to give the broker enough time to fill the larger request, and increase max.poll.records if your per-record processing is very fast.

Advanced Partition Assignment Strategies

The default partition.assignment.strategy is RangeAssignor followed by CooperativeStickyAssignor. While these work well, understanding the alternatives can help in specific scenarios.

  • RangeAssignor: Assigns partitions on a per-topic basis. Can lead to imbalance if the number of consumers doesn’t evenly divide the number of partitions.
  • RoundRobinAssignor: Assigns partitions one-by-one to consumers. Tends to create a more balanced assignment across all subscribed topics.
  • StickyAssignor: Aims to be as balanced as possible while minimizing partition movement during a rebalance. When a rebalance happens, it tries to keep existing assignments intact, which can significantly reduce the impact on stateful consumers.
  • CooperativeStickyAssignor: An improvement on the StickyAssignor that uses an incremental rebalancing protocol. Instead of a “stop-the-world” pause, consumers only give up the partitions they need to and can continue processing others, drastically reducing rebalance downtime. Using this strategy requires broker and client support (Kafka 2.4+).

If you are experiencing long rebalances, switching to the CooperativeStickyAssignor can be a game-changer.

Dealing with a Kafka consumer lag explosion can be stressful, but it’s a solvable problem. The key is to shift from a reactive to a proactive mindset. By continuously monitoring consumer lag and rebalance metrics, you can gain insight into your system’s behavior. From there, stabilizing your consumer group by tuning session timeouts and processing intervals provides the foundation for performance. Finally, optimizing throughput with careful adjustments to fetch sizes and batch parameters will ensure your consumers can handle the load. By mastering these concepts, you can build and maintain a robust, high-performance Kafka pipeline that reliably delivers data to the applications that depend on it.

Ready to get deep, real-time insights into your Kafka consumer performance? Try Netdata for free and start monitoring your entire infrastructure in minutes.