Confluent
Confluent logoConfluent · Feature trail

Kafka Request Purgatory Performance

2 posts · Oct 2015

What this trail covers

This feature thread tracks the evolution of Kafka's request purgatory, focusing on performance and memory efficiency. The initial implementation using Java's DelayQueue suffered from O(log n) insert/delete costs and inefficient purging, leading to potential OutOfMemoryErrors and performance degradation under high load. The new design leverages Hierarchical Timing Wheels and doubly linked lists to achieve O(1) insert/delete operations for completed requests and a more efficient purging mechanism. Benchmarks demonstrate significant improvements in request per second (RPS) throughput and reduced CPU usage, especially in high enqueue rate scenarios. The new design also optimizes the driving clock using DelayQueue by enqueuing task buckets instead of individual tasks, further reducing overhead.

All Confluent trails