Developer tools · Capacity
Kafka partition calculator.
Partition count from target throughput, plus replicated storage for your retention window.
Inputs
Topic sizing
Enter the values.
How many partitions does a Kafka topic need?
Confluent's guidance is to measure the throughput one partition can handle for production (p) and for consumption (c), pick a target throughput (t), and use at least max(t/p, t/c) partitions. Measure p and c yourself: consumption depends on what your application does with each message.
Worked example. A target of 100 MB/s with 10 MB/s per partition on the producer side and 20 MB/s on the consumer side needs max(10, 5) = 10 partitions, limited by the producers. Retaining 7 days at 100 MB/s is 6.05 x 10^13 bytes (55.0 TiB) of data; with a replication factor of 3 that is 165 TiB across the cluster, or about 27.5 TiB per broker on 6 brokers.
Storage here assumes the full target rate for the whole retention window and ignores compression, compaction, index files and segment rounding, so it is an upper bound for steady load. The same Confluent article suggests limiting partitions per broker to two to four thousand for availability; the article dates from 2015 and newer Kafka versions support far more, so check your version's guidance. Partitions can be added later but changing the count reshuffles key-to-partition mapping.
Frequently asked questions
How do I calculate the number of Kafka partitions?
Use at least max(t/p, t/c), where t is the target throughput and p and c are the throughput a single partition can sustain for producing and consuming. Measure p and c on your own hardware and code.
How much disk does Kafka retention need?
Throughput times retention time times the replication factor, before compression. At 100 MB/s for 7 days with replication factor 3 that is about 165 TiB (1.8 x 10^14 bytes) across the cluster.
Is there a limit on partitions per broker?
The Confluent article suggests two to four thousand per broker as a guard for availability, but it is from 2015 and later versions raised the practical limits, so check current guidance for your version.
Can I add partitions to a topic later?
Yes, but keyed messages will map to different partitions afterwards, so plan the count with headroom if ordering per key matters.
Sources
Checked
The partition formula and the per-broker guidance are from the Confluent article (published 2015). Storage is simple multiplication of your inputs. Runs entirely in your browser. Nothing you type is sent or stored.
Scope
Planning estimates, not guarantees. Real systems add overhead this model leaves out and behave differently under load. Measure on your own data and load-test before committing to a design or a bill.