Home
ArenaGraphSignalTopics
/Apache Kafka and Event-Driven Systems: Building Real-Time Streaming Pipelines
Chapter 10 • Module 2 8 min breakdown +15 XP Module

Kafka Capacity Planning and Partition Reassignment: Adding Brokers Safely

From Track:Apache Kafka and Event-Driven Systems: Building Real-Time Streaming PipelinesEvent-Driven Architecture & Distributed Systems

As data volumes grow, streaming architects must scale Apache Kafka clusters horizontally by provisioning new broker nodes.

However, a critical operational reality often catches teams off guard:

When you add new broker nodes to an existing Kafka cluster, Kafka DOES NOT automatically move existing partitions onto the new nodes.

Newly added brokers sit completely idle until new topics are created or you explicitly execute a Throttled Partition Reassignment Plan.


1. Mathematical Capacity Planning Model for Kafka

Before provisioning hardware, use this mathematical model to size CPU, Network, and Disk storage:

Interactive Blueprint
Rendering diagram...

Worked Capacity Example:

  • Target Ingress: continuous write traffic.
  • Replication Factor: .
  • Retention Period: .
  • Active Consumer Groups: independent consumer groups.

1. Storage Calculation:

2. Network Egress per Broker Node (Assuming 6 Broker Cluster):

  • Inter-broker follower replication: .
  • Consumer reads: .
  • Total Cluster Network Egress: ().
  • Per-Broker Network Requirement: (Provision NICs).

2. The Step-by-Step Partition Reassignment Runbook

When expanding a cluster from 3 brokers (101, 102, 103) to 5 brokers (101, 102, 103, 104, 105):

Interactive Blueprint
Rendering diagram...

Step 1: Create Topics JSON Input (topics-to-move.json)

json
Loading code editor...

Step 2: Generate Reassignment Plan

Run the CLI tool specifying the target broker list:

bash
Loading code editor...

Step 3: Execute Reassignment with Network Throttling (CRITICAL)

[!CAUTION] If you run partition reassignment without --throttle, the brokers will replicate historical data at maximum unthrottled link speed (). This will saturate broker network interfaces and disk I/O, causing massive request timeout spikes across active production applications.

Apply a strict bandwidth cap (e.g., ):

bash
Loading code editor...

Step 4: Verify and Decommission Throttling

Periodically poll status until migration completes:

bash
Loading code editor...

Once all partitions report Reassignment completed successfully, remove the throttle so ongoing production replication is not capped:

bash
Loading code editor...

3. Summary & Best Practices

  1. Never Execute Unthrottled Reassignments: Always cap reassignment bandwidth to no more than of available NIC capacity.
  2. Execute During Low-Traffic Windows: Schedule partition moves during off-peak hours to minimize impact on real-time consumer SLAs.
  3. Verify Throttle Removal: Ensure dynamic broker throttle configs are explicitly cleared after reassignment completes.
Milestone Verification

Ready for the next lesson?

Mark this module complete to record verified progress and earn +15 XP toward your architect profile.