RabbitMQ vs. Kafka: Throughput Showdown

Kafka typically achieves higher raw throughput, often handling millions of messages per second, while RabbitMQ generally offers lower latency at lower throughputs, with production benchmarks usually in the tens to low hundreds of thousands of messages per second when publisher confirms are enabled.

The top 3

  1. Kafka's Million-Message Throughput Dominance: Kafka consistently achieves over 1.5 million messages per second in recent benchmarks, significantly outpacing RabbitMQ's typical peak of 120,000 messages per second, although RabbitMQ has demonstrated 1 million messages per second in older, combined ingress/egress tests.
  2. Latency: RabbitMQ's Low-Volume Edge, Kafka's Consistent High-Volume Performance: RabbitMQ offers lower baseline latency (1-5 milliseconds) for low-volume, real-time messaging due to its push-based model. In contrast, Kafka maintains more consistent latency (5-15 milliseconds baseline, with a p99 of 42ms at 1.5M msg/s) even under high throughput, where RabbitMQ's latency can degrade significantly.
  3. Stress Test: RabbitMQ's Memory Cliff vs. Kafka's Disk Resilience: Under heavy, sustained load, RabbitMQ's in-memory message storage can lead to throughput drops of 80% or more when its memory threshold is hit, potentially blocking publishers. Kafka, by writing all messages directly and sequentially to disk, avoids memory exhaustion as a primary failure mode, offering greater stability against sudden traffic surges.

Sources

Open the full topic