DEV Community

Cover image for RabbitMQ vs Kaleidoscope: How the new broker achieves 12x message throughput (1100% speedup)
George Papadopoulos
George Papadopoulos

Posted on • Updated on

RabbitMQ vs Kaleidoscope: How the new broker achieves 12x message throughput (1100% speedup)

In today's data-driven world, a fast and efficient message broker is essential for building efficient and scalable applications. In this blog post, we'll delve into a comparison between RabbitMQ, a well-established message broker, and Kaleidoscope, a new high-performance broker from the Phoesion Glow framework. We'll take a close look at their benchmark results to see how they perform in real-world scenarios.

Overview of RabbitMQ and Kaleidoscope

RabbitMQ is one of the most popular message brokers available.
It implements the Advanced Message Queuing Protocol (AMQP) and is renowned for its reliability, robustness, and extensive feature set, making it a staple in many production environments.

Kaleidoscope, is a new transient message broker, written entirely in .NET 8.0. It is engineered to deliver high performance as it was designed to be the backbone of Phoesion Glow, a cloud backend service development and cluster management solution. In peer-to-peer (P2P) mode, the Kaleidoscope broker acts as the routing authority, sending peer/routing updates to the clients, while the clients form a P2P mesh and can send data directly to each other, thus removing significant resource overhead (cpu/memory/networking) from the broker and improving throughput and latency for the clients.

Benchmark Results

The benchmark tests yielded the following results:

Broker Message Throughput Latency
Kaleidoscope (Normal) 140,000 0ms
Kaleidoscope (P2P) 710,000 0ms
RabbitMQ - Direct exchange 60,000 80ms
RabbitMQ - Topic exchange 40,000 80ms
  • Message Throughput: messages per second (higher is better)
  • Latency: time (milliseconds) for the first message to arrive

Charts

Image description

Another chart without Kaleidoscope P2P mode, comparing the performance using the same topology

Image description

These results highlight a significant performance advantage for Kaleidoscope, especially in P2P mode.

Benchmark Setup

To provide a fair comparison, both RabbitMQ and Kaleidoscope were tested under the same conditions:

  • Hosting: Both broker service and benchmark client run on the same machine, using the loopback interface (127.0.0.1) to ensure networking consistency.
  • Hardware: The same hardware setup and machine were used for both tests to ensure consistency.
  • Metrics: The primary metric was message throughput, measured in messages per second. The latency of the first message was also measured as a secondary metric.
  • Scope: The scope of the benchmark includes both broker and client libraries (as they would be used in a real-world application). For RabbitMQ the "RabbitMQ.Client" library is used.

Machine specifications:

  • CPU: Intel Core i7-7700K @ 4.20GHz
  • Memory: 32.0 GB @ 2133 MHz
  • OS: Windows 10 (22H2)

Benchmark design:

  • OS Processes: We have one broker process and one benchmark-app process.
  • Benchmark-app: will have 2 connections to the broker, one for the producer and one for the consumer.
  • Producer: spawns 40 concurrent C# Tasks that will flood-send messages to the broker.
  • Consumer: counts the received messages and once all messages are received the benchmark is completed.
  • Payload: 250 byte-array (pre-serialized) message.

Broker setup:

  • The brokers will have one exchange, with a binding to one queue. The queue must NOT be exclusive since in a real-world scenario there will be multiple consumers (future benchmark).
  • For RabbitMQ, both 'Topic' and 'Direct' exchange types were tested, while Kaleidoscope uses only a 'Topic'-like exchange.
  • Both brokers use transient queues and messages

Constraints:

  • No messages are allowed to be lost, so Acknowledgments must be enabled in both brokers.
  • No duplicate messages are allowed.

Performance Analysis

P2P mode

  • Kaleidoscope: Achieving an impressive 710,000 messages/second, making it highly suitable for applications requiring rapid, low-latency communication between endpoints.
  • RabbitMQ: P2P mode is not supported.

Normal mode

  • Kaleidoscope: Even in normal mode, Kaleidoscope's throughput of 140,000 messages/second more than doubles RabbitMQ's performance, indicating its efficiency in handling standard messaging tasks.
  • RabbitMQ: Handles 40.000 to 60,000 messages/second, which, while solid, is outpaced by Kaleidoscope.

Exchange type

  • Kaleidoscope: Only supports 'Topic' exchange
  • RabbitMQ: The 'Direct' exchange type, with its reduced overhead, offers better performance than the 'Topic' exchange but is suited for more specific scenarios

Use cases

While both brokers can be used similarly, each is uniquely designed with specialized features tailored to their specific use cases.

  • RabbitMQ: Better queuing features like persistence, dead-letter handling, and job-scheduling
  • Kaleidoscope: Faster messaging/RPC throughput with low latency, orchestrating clients in p2p to reduce (CPU/network) overhead, tunneling and streaming as a service-bus for cloud backend.

Topology

These diagrams show how data move in different setups:

  • RabbitMQ using Topic/Direct exchanges. \ Image description
  • Kaleidoscope in Normal mode. \ Image description
  • Kaleidoscope in P2P mode.\ Image description

Conclusion

These benchmarks suggest that while RabbitMQ remains a reliable and feature-rich option, Kaleidoscope offers substantial performance benefits, particularly for high-throughput applications. The higher message throughput can lead to more responsive systems and better utilization of resources, which is crucial for modern, data-intensive applications.

Kaleidoscope is not available (documented/supported) as a standalone product, but instead, it serves as the backbone of the Phoesion Glow framework by interconnecting all cloud components/services, providing significant performance benefits with its high message throughput and low latency.

As always, it's important to consider your specific requirements and test in your environment to determine the best fit for your needs. If you have any questions or insights based on your experiences with these message brokers, feel free to share them in the comments below!

More benchmarks are needed to get the full picture. Some benchmarks planned for the future include:

  • Test on Linux OS
  • Test using multiple machines with producer, broker and consumer each running on a separate machine
  • Test using multiple consumers.
  • Test clustering

Stay tuned for more insights and benchmarks as we continue to explore the capabilities of the latest messaging technologies!

Source Code

Source code is available at https://github.com/gepa21/broker_benchmark

More info about getting started with Phoesion Glow

Top comments (0)