This repository benchmarks and compares three popular message brokers:
- RabbitMQ - Robust message queue with advanced routing
- Redis - In-memory data store with pub/sub capabilities
- Kafka - Distributed event streaming platform
The goal is to evaluate performance metrics and identify the best broker for your network requirements.
Before running the benchmark, ensure you have set up:RabbitMQ , Redis and Kafka .
Then install Python dependencies:
pip install -r requirements.txtStart the Sender:
python main.py --role senderStart the Receiver (in another terminal):
python main.py --role receiverThe sender and receiver will communicate through the configured broker, measuring throughput and latency.
Edit cfg/config.yaml to customize the benchmark:
# Broker Configuration
rabbit:
address: "localhost"
username: "guest"
password: "guest"
virtual-host: "/"
redis:
host: "localhost"
port: 6379
db: 0
# Benchmark Settings
num_rounds: 100 # Number of messages to send
message_size: 15 # Message size in MB (max 16 MB)├── main.py # Entry point (RabbitMQ, Redis, Kafka runners)
├── client.py # Client utilities
├── src/
│ ├── Utils.py # Configuration loader
│ ├── rabbitmq/ # RabbitMQ sender/receiver
│ ├── redis/ # Redis sender/receiver
│ └── kafka/ # Kafka sender/receiver
├── cfg/
│ └── config.yaml # Broker configuration
│
└── requirements.txt # Python dependencies
The benchmark measures:
- Message throughput (messages/sec)
- Latency (milliseconds)
- Resource utilization
- Maximum message size: 15 MB
- Default rounds: 100 rounds
- Ensure all brokers are running before starting the benchmark