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:
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):
Step 1: Create Topics JSON Input (topics-to-move.json)
Step 2: Generate Reassignment Plan
Run the CLI tool specifying the target broker list:
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., ):
Step 4: Verify and Decommission Throttling
Periodically poll status until migration completes:
Once all partitions report Reassignment completed successfully, remove the throttle so ongoing production replication is not capped:
3. Summary & Best Practices
- Never Execute Unthrottled Reassignments: Always cap reassignment bandwidth to no more than of available NIC capacity.
- Execute During Low-Traffic Windows: Schedule partition moves during off-peak hours to minimize impact on real-time consumer SLAs.
- Verify Throttle Removal: Ensure dynamic broker throttle configs are explicitly cleared after reassignment completes.