Apache Kafka performance tuning and sizing

Making Kafka fast and right-sized: partition counts, producer and consumer settings, compression, storage and retention sizing, large messages and compacted topics.

How many partitions does a Kafka topic need?

Sizing partitions from target throughput and consumer parallelism: per-partition throughput, ordering by key, the cost of too many partitions on brokers and OS limits, and why partitions can be added but not removed.

Tuning Kafka producers for throughput and latency

Producer settings that matter: batch.size and linger.ms, compression, acks and idempotence defaults, buffer memory and in-flight requests, with example profiles for high throughput and low latency.

Tuning Kafka consumers

Consumer settings that decide throughput and stability: fetch.min.bytes and fetch waits, max.poll.records, processing time against max.poll.interval.ms, and scaling consumers up to the partition count.

Handling large messages in Kafka

Sending records above the 1 MB default: message.max.bytes and topic max.message.bytes, matching producer and consumer limits, compression, and the claim-check pattern of storing payloads elsewhere.

Talk to our team.

Tell us what you're working on, whether it's a deployment, an audit, a security test or a cyber range. You'll speak with an engineer who can help you scope it.

  • 30-minute call: free, with no obligation.
  • NDA on request: we can sign before you share details.
  • Clear next steps: a scope and plan after the call.