Kafka Partition Calculator

Size Kafka partitions from produce throughput, consumer parallelism, and retention — with storage and per-broker sanity checks.

Kafka Partition Calculator

Estimate partitions from throughput, consumer parallelism, and retention storage — then sanity-check against broker capacity.

Estimates only — real hot partitions, key cardinality, and consumer lag can require more partitions. Prefer increasing partitions gradually; shrinking is expensive.

How Partition Count Is Chosen

Kafka scales consumers in a group roughly one partition per active consumer for a topic. You also need enough partitions so aggregate produce/consume throughput fits within what each partition can sustain.

This calculator takes the maximum of:

  1. Throughput-based partitions = target MB/s ÷ per-partition MB/s capacity
  2. Parallelism-based partitions ≈ number of consumers you want running in parallel
  3. Message-volume check using peak messages/sec × average size

Practical Tips

  • Prefer increasing partitions when scaling out; decreasing later requires recreating the topic.
  • More partitions improve parallelism but raise open file handles, rebalance time, and end-to-end latency under some workloads.
  • Watch key cardinality — a hot key funnels traffic into one partition regardless of count.
  • Round toward a multiple of broker count when you care about even replica placement.

Typical Per-Partition Capacity

Use your own benchmarked numbers when you have them. Ballpark starting points for planning are often on the order of 5–20 MB/s per partition depending on disk, batching, compression, and follower fetch load — measure on your hardware.