Apache Kafka Streaming (50 Qs)•Part 3: Advanced Internals, Scale & Production Architecture (Senior / Lead)
Kafka Cluster Sizing and Network Bottlenecks.
senior LevelSystem DesignApache KafkaMicroservices
In Simple Words: When sizing a production Kafka cluster:
- Network Bandwidth is almost always the first bottleneck, not CPU or disk:
- Total Inbound = $\text{Write MB/s} \times \text{Replication Factor}$.
- Total Outbound = $\text{Write MB/s} \times \text{Follower Replicas} + \text{Read MB/s} \times \text{Number of Consumer Groups}$.
- Partition Sizing Rule of Thumb:
- Limit total partitions per broker to $\le 4,000$ and total partitions per cluster to $\le 200,000$ (on ZooKeeper) or millions (on KRaft).
- Target partition throughput between 10MB/s and 50MB/s.