How do I load test a RabbitMQ server (Either using JMeter, python or any other tool..)?

安稳与你 提交于 2019-12-05 14:04:14

You can use rabbitmq's Java Client Tools:
https://www.rabbitmq.com/java-client.html

It comes with a PerfTest:
https://www.rabbitmq.com/java-tools.html

You can run it using this command:

./runjava.sh com.rabbitmq.examples.PerfTest \
-h amqp://<user>:<password>@<host>:<port>/<vhost> \
-x <number_of_producers> \
-y <number_of_consumers> \
-s <message_size> \
-C <total_number_of_message> \
-u <queue_name>

There are other flags you can use too if you look at the documentation or the source you can see what they are.

Update/Shameless Plug
I wrote a web app that pulls these tools into one place https://github.com/johnlonganecker/rabbitmq-performance-app

Once you have jar with you, place it under jmeter/lib/ext folder. Now open Jmeter and prepare a test plan.

Step 1: To click test plan, right click Test Plan and go to Add->Thread(Users)->Thread Group. Give a name to Thread Group:

Step 2: Then right click your group and go to Add->Sampler->AMQP Publisher:

Give Host as "localhost", Port as "5672", Username and Password as "guest/guest".

Also select/de-select features like "durable","persistence" etc as per your exchange setup.

Step 3: Then right click your group and go to Add->Listener->Graph Results:

Step 4: Now save the test plan and execute.

For more detailed setup, you can refer to my blog at:

http://jatinanejablog.blogspot.in/2016/06/configure-jmeter-to-load-test-rabbit-mq.html

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!