Kafka Partition Calculator
How many partitions does your Kafka topic need? Enter your workload characteristics and get a recommendation with step-by-step math, tradeoff analysis, and an interactive slider to explore alternatives.
Presets
Recommended Partitions
12partitionsrange: 12–30
Calculation Steps
Step 1: Throughput requirement1,000 msgs/sec × 1.0 KB = 1000.0 KB/sec
Step 2: Single consumer capacity1 consumer processes 1 msg per 10ms = 100 msgs/sec
Step 3: Minimum partitions for throughput1,000 msgs/sec ÷ 100 msgs/sec per consumer = 10 partitions minimum
Step 4: Consumer instance alignmentmax(10 throughput-based, 6 consumers) = 10
Step 5: Peak adjustmentPeak 3x → 3,000 msgs/sec ÷ 100 = 30 partitions at peak
Step 6: Broker-aligned recommendationRound 10 to next multiple of 3 brokers = 12
Step 7: Storage estimate1000.0 KB/sec × 86,400 sec/day × 7 days × 3 replicas
Tradeoffs
Conservative6p
Pros
+ Lower broker overhead
+ Faster rebalancing
+ Fewer open file handles
Cons
− Max 6 consumers
− Cannot handle sustained throughput
− Less room to scale
Recommended12p
Pros
+ Handles sustained throughput
+ Even distribution across 3 brokers (4 each)
+ Allows scaling to 12 consumers
Cons
− Moderate broker overhead
Aggressive24p
Pros
+ Handles peak without lag
+ Room for 24 consumers
+ Future-proof for growth
Cons
− Higher broker memory and file handle usage
− Slower rebalancing on consumer join/leave
− More partitions than currently needed
What If? — Explore partition count
12
Consumer utilization83.3%
Active / Idle consumers6
Lag at peak (3x)Yes — lag expected
Per broker4.0
Estimated total storage:~1.69 TB
⚠ Peak traffic (3x) requires 30 partitions. With 12, expect consumer lag during spikes unless you auto-scale consumers.