Simple rabbitmq benchmark tool which produce high load messages using goroutines as worker threads.
- Download pre-compiled binaries from release page.
tar -xvf rabbitmq-benchmark_linux_amd64.tar.gz
chmod +x rabbitmq-benchmark
- Running rabbitmq-benchmark as consumer
./rabbitmq-benchmark -r consumer -t 4 -s 20 -url amqp://guest:guest@localhost:5672
- Running rabbitmq-benchmark as producer
./rabbitmq-benchmark -r producer -t 4 -s 20 -url amqp://guest:guest@localhost:5672
Consumer & producer needs to run in separate shell as selected using
-r
flage.
- Basic cli usage
Usage of ./rabbitmq-benchmark:
-debug
enable debug logging
-f int
producer message frequency
-n string
name of the amqp queue (default "queue")
-quorum
enable quorum queue type
-r string
Select consumer or producer (default "consumer")
-s int
producer message size (default 10)
-t int
Num of worker threads (default 3)
-url string
Rabbitmq connection string (default "amqp://guest:guest@localhost:5672")
Golang build from source.
git clone github.com/ragul28/rabbitmq-benchmark
cd rabbitmq-benchmark
make build
- Run cluster using docker compose
cd cluster/
docker-compose up -d
- Enable classic queue mirroring & auto node sync
docker exec -it rabbitmq-01 rabbitmqctl set_policy ha-fed \
".*" '{"ha-mode":"all", "federation-upstream-set":"all", "ha-sync-mode":"automatic", }' \
--priority 1 \
--apply-to queues
# add user
rabbitmqctl add_user admin admin
# set user as admin
rabbitmqctl set_user_tags admin administrator
# set all permission
rabbitmqctl set_permissions -p / admin ".*" ".*" ".*"