This feature thread tracks the evolution of Kafka producer partitioning strategies, focusing on improving latency and efficiency. It covers the introduction and impact of sticky partitioning for null-keyed records, which aims to create larger batches and reduce overhead. The thread also includes performance benchmarks and analysis of CPU utilization to quantify the benefits of these improvements. This post details how a Tier-1 bank achieved sub-5ms p99 latency for trading pipelines by meticulously tuning Kafka brokers, producers, and consumers, leveraging OpenMessaging Benchmark for reproducible results, and focusing on a 'lowest baseline first' methodology with a single partition to isolate latency contributors. Key tuning areas included broker configurations (network/IO threads, replica fetchers, segment size, heap), producer configurations (linger.ms, batch.size, compression, idempotence, acks), and consumer configurations (max.poll.records, max.poll.interval.ms). Infrastructure upgrades and JVM tuning (Generational ZGC) were also critical.
1 post · 2019–2026