blog by OSO

Kafka Clusters: Achieving Load Balancing

Sion Smith
Sion Smith 30 June 2023
OSO guide to load balancing in Kafka clusters, white title text on a navy panel with a lime Blogs label.

Updated November 2026: We have rewritten this guide into a question-led format, clarified when Cruise Control helps versus a placement-first strategy for data-injection workloads, and checked the facts against the current Apache Kafka operations docs and the Cruise Control project.

Uneven load is one of the fastest ways to turn a healthy Kafka cluster into an expensive one. A few brokers sit hot on disk or network while others idle, under-replicated partitions appear during a broker failure, and consumer lag grows on the partitions that happen to land on the busy nodes. Load balancing is how you stop that drift.

This guide explains what load balancing means in Kafka clusters, how partition and leader placement drive broker load, when continuous rebalancers such as Cruise Control earn their keep, and a replica placement strategy OSO engineers use for data-injection workloads where traffic is already roughly even per partition.

What is load balancing in a Kafka cluster?

Load balancing in a Kafka cluster is the practice of keeping partition replicas, partition leaders and consumer assignments spread so that no broker or consumer becomes a hotspot.

Two layers matter:

  • Broker load: where partition replicas and leaders live. Leaders handle produce and fetch traffic for a partition; followers replicate. Disk usage follows the replicas you place on each broker, including retention differences between topics.
  • Consumer load: how a consumer group divides partitions among members. Kafka’s group protocol assigns partitions; a bad key design or uneven partition traffic still leaves some members busier than others even when broker placement is perfect.

Producer and consumer traffic patterns change through the day, and topics often have different retention. That is why a cluster that looked balanced at creation can skew weeks later. For the building blocks, see our Kafka basics and key concepts guides.

How do partitions and replicas shape Kafka cluster load?

Partitions and replicas shape load because every produce, fetch and replication stream is tied to a specific leader or follower replica on a specific broker.

FactorWhat it drivesWhat goes wrong when it is uneven
Partition countParallelism for producers and consumersToo few partitions cap throughput; too many add overhead
Leader placementProduce and consumer fetch CPU and networkA few brokers own most leaders and become hot
Replica placementDisk and follower networkDisk fills on one broker while peers stay empty
Partition keysPer-partition trafficHot keys overload a handful of partitions
Retention per topicDisk growth rateLong-retention topics pin disk to whichever brokers hold them

Rack-aware replica assignment (broker.rack and a rack-aware replica selector) spreads replicas across failure domains so a single rack outage does not take every replica of a partition offline. That is availability first, but it also stops you stacking every heavy replica on the same set of brokers.

For throughput and monitoring angles on the same problem, see Kafka performance best practices.

Why is continuous rebalancing expensive?

Continuous rebalancing is expensive because it moves partition data between brokers to chase a load model, and every move costs network, disk and time while the cluster is still serving traffic.

Tools such as LinkedIn Cruise Control (now maintained as cruise-control-for-kafka) collect broker metrics, build a cluster load model, propose an optimisation and then execute partition and leadership moves. Confluent’s Auto Data Balancer follows the same idea. Amazon MSK documents Cruise Control for MSK clusters with concurrency caps such as num.concurrent.partition.movements.per.broker (default 5) and optional throttles so a rebalance does not starve clients.

Those tools are valuable when:

  • brokers have joined or left and replicas are skewed;
  • disk or network utilisation is clearly uneven;
  • you need self-healing after a broker failure.

They are a poor default for every change when your workload is already even per partition. Data movement lengthens the change window, raises infrastructure cost during the move and can add latency while throttles fight client traffic. Prefer placement that stays balanced as you grow, and reserve Cruise Control for measured skew. Our Cruise Control 101 covers how proposals and execution work in practice.

How should you place replicas for data-injection workloads?

For data-injection workloads, place replicas so each broker holds a similar share of partition replicas and leaders per topic, which keeps CPU, disk and network aligned without constant reshuffles.

Data injection — shipping logs, metrics or change events into Kafka for later warehouse or lake analysis — often shows this pattern:

  • events are assigned to partitions randomly or with a well-distributed key inside a topic;
  • consumers scan partitions continuously;
  • producers and consumers do not need a fixed partition count beyond enough parallelism.

When those hold, a deliberate partition replica placement strategy beats continuous rebalancing:

  1. Size partitions from a simple SKU. Pick a partition count from a small set of sizes (for example tied to broker count) so every topic of a given SKU lands the same shape on the cluster.
  2. Equal replicas and leaders per broker per topic. When you create or expand a topic, generate a replica assignment that gives each broker the same number of replicas and leaders for that topic.
  3. Aggregate across topics. Once every topic is even, the sum across topics stays even, so hardware utilisation for CPU, storage and network tracks the peer brokers.

You can apply the assignment with kafka-reassign-partitions.sh (or your operator’s equivalent) at topic create and expand time, with a throttle if you must move existing data. The point is to bake balance into the layout instead of correcting it afterwards.

ApproachBest whenMain cost
Placement-first (SKU + even replicas/leaders)Per-partition traffic is already similarUp-front assignment discipline
Cruise Control / Auto Data BalancerMeasured skew, broker add/remove, self-healingData movement, longer change windows
Manual ad-hoc movesRare one-off fixesEasy to reintroduce skew

How do you keep a Kafka cluster balanced as it changes?

You keep a Kafka cluster balanced by treating every topology change as a placement decision, not only a capacity decision.

ChangeWhat to doWhy it preserves balance
New topicGenerate an even replica and leader assignment at create timeAvoids a skewed starting layout
More partitionsRaise the SKU, then assign new partitions evenlyExtra parallelism without stacking on busy brokers
Add brokersCreate new partitions (or reassign a controlled set) onto the new brokersAbsorb growth without emptying old brokers overnight
Traffic or retention changeUsually nothing if each topic is already evenLoad stays proportional across brokers
Remove brokersPlan data movement (reassign or migrate) with throttlesShrink without leaving under-replicated risk unmanaged

Adding brokers without placing new work on them leaves the old brokers hot. Removing brokers always means data movement; throttle it and prefer moving to a prepared layout rather than a free-for-all. Scaling patterns more broadly are covered in how to scale Apache Kafka in your organisation.

When should you use Cruise Control?

Use Cruise Control when metrics show real skew or when brokers have joined, left or failed — not as a substitute for even topic creation.

A practical split OSO engineers recommend:

  • Placement-first for data-injection and other workloads where partitions receive similar traffic. Create and expand topics with even replica and leader maps.
  • Cruise Control when disk, CPU or network charts disagree across brokers, after a failure, or when you must drain a broker. Approve proposals, cap concurrent moves and set a replica movement throttle so clients keep their SLA.
  • Fix keys and partition counts first if a few partitions are hot. No balancer can hide a bad key.

Key takeaway: Balance Kafka clusters at topic create and expand time with even replica and leader placement. Reach for Cruise Control when metrics show skew or topology changes force data movement — not as the everyday way to keep injection workloads even.

If you are planning a rebalance or a broker expansion and want a second pair of eyes on the layout, OSO’s Kafka support and Kafka services teams work with production clusters every week, including fully managed Kafka when you would rather not run the control plane yourself.

Frequently asked questions

What is load balancing in a Kafka cluster?

Load balancing in a Kafka cluster means distributing partition replicas and leaders across brokers, and partitions across consumers, so that CPU, disk and network stay roughly even. It covers broker placement and consumer-group assignment.

How do you balance load across Kafka brokers?

You balance broker load by placing a similar number of replicas and leaders on each broker per topic, using rack-aware assignment for failure domains, and reassigning partitions when brokers are added or removed. Cruise Control can automate proposals when metrics show skew.

What causes uneven load in Kafka clusters?

Uneven load usually comes from skewed partition keys, uneven leader placement, topics with very different retention stacked on the same brokers, or broker add/remove without a planned reassignment. Hot partitions will keep one broker busy no matter how good the rest of the layout is.

When should I use Cruise Control for Kafka?

Use Cruise Control when broker metrics show clear imbalance, when you need to drain or restore a broker, or after failures that leave replicas poorly placed. Skip continuous rebalancing when your topics already receive even per-partition traffic and you can keep that with placement at create time.

Does adding partitions rebalance a Kafka cluster?

Adding partitions increases parallelism but does not by itself rebalance existing data. New partitions start empty; you still need an even replica and leader assignment for those partitions, and existing skewed partitions stay where they are until you reassign them.

How is consumer-group load balancing different from broker load balancing?

Consumer-group load balancing assigns partitions to consumer instances in a group so processing work is shared. Broker load balancing places replicas and leaders on brokers. You can have even consumer assignments and still overload a broker if too many hot leaders live on it.

Need a balanced Kafka cluster in production?

Talk to OSO's Kafka engineers about partition placement, Cruise Control and scaling plans before hot brokers become an incident.

CONTACT US
OSO
Privacy Overview

This website uses cookies so that we can provide you with the best user experience possible. Cookie information is stored in your browser and performs functions such as recognising you when you return to our website and helping our team to understand which sections of the website you find most interesting and useful.