Performance Comparison of Kafka, RabbitMQ, and RocketMQ for Small Message Sending
This article evaluates the server‑side performance of three popular message middleware platforms—Kafka, RabbitMQ, and RocketMQ—by measuring throughput and latency when sending small 124‑byte messages, revealing that Kafka leads, followed by RocketMQ and then RabbitMQ.
Introduction In distributed systems, message middleware is widely used for inter‑service data exchange and asynchronous decoupling. Among many open‑source options, RocketMQ (the core of MetaQ) has recently been open‑sourced and attracted attention.
Which middleware performs best? To answer this, the testing team compared three common products—Kafka, RabbitMQ, and RocketMQ.
Kafka is an Apache‑top‑level, distributed publish‑subscribe system originally designed for high‑throughput log collection. It uses a pull‑based consumption model, supports replication since version 0.8, and does not enforce strict transaction guarantees, making it suitable for massive data‑generation services.
RabbitMQ is an Erlang‑based open‑source queue system that implements the AMQP protocol. AMQP emphasizes messaging, routing (point‑to‑point and pub/sub), reliability, and security, and is often used in enterprise environments where data consistency and stability are paramount, with performance being a secondary concern.
RocketMQ is Alibaba’s open‑source Java‑based middleware, offering high throughput and high availability for large‑scale distributed applications. Although inspired by Kafka, it adds optimizations for reliable transmission and transactional support, and is widely used within Alibaba for transactions, streaming, and log distribution.
Test Objective Compare the performance of sending small messages (124 bytes) for Kafka, RabbitMQ, and RocketMQ, focusing solely on server‑side metrics. The benchmark increases producer pressure until throughput plateaus and response time grows, indicating the server’s performance bottleneck and the optimal throughput.
Test Scenario
In a synchronous sending scenario, the three middleware exhibit distinct behaviors:
Kafka achieves a throughput of 173 k messages/s, thanks to its queue model that enables linear disk I/O, though the broker’s disk I/O becomes the bottleneck.
RocketMQ follows with 116 k messages/s; its disk I/O utilization approaches 100 %. RocketMQ writes messages to memory, returns an ACK immediately, and flushes to disk asynchronously via a dedicated thread, writing files sequentially.
RabbitMQ reaches 59.5 k messages/s while consuming higher CPU resources. Its heavyweight AMQP implementation sacrifices throughput for reliability. In a persistent‑message test, RabbitMQ’s throughput drops to around 26 k messages/s.
Test Conclusion For server‑side handling of synchronous small‑message sending, the performance ranking is Kafka > RocketMQ > RabbitMQ.
Appendix – Test Environment
The server was a single‑machine deployment; hardware specifications and software versions are shown in the accompanying images.
Appendix – Test Scripts
Test scripts are illustrated in the provided screenshots.
Future Work While Kafka currently leads in the simplest small‑message scenario, RocketMQ’s proven resilience in high‑traffic events (e.g., Double Eleven) suggests it may have advantages in broader internet application contexts.
© Content sourced from the web; all rights belong to the original author. For infringement concerns, please contact us for removal. Original link: http://jm.taobao.org/2016/04/01/kafka-vs-rabbitmq-vs-rocketmq-message-send-performance/
Signed-in readers can open the original source through BestHub's protected redirect.
This article has been distilled and summarized from source material, then republished for learning and reference. If you believe it infringes your rights, please contactand we will review it promptly.
Full-Stack Internet Architecture
Introducing full-stack Internet architecture technologies centered on Java
How this landed with the community
Was this worth your time?
0 Comments
Thoughtful readers leave field notes, pushback, and hard-won operational detail here.
