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

我怕爱的太早我们不能终老 提交于 2019-12-07 07:59:00

问题


I have been given access to a RabbitMQ server to do a load test on it. I'm completely new to servers and AMQ protocol. I've been researching online to see what are some different methods. So far I'm investigating two methods.

  1. JMeter; I have found this project: https://github.com/jlavallee/JMeter-Rabbit-AMQP#build-dependencies . It gives me a jar file which I can create JMeter AMQP consumer and publisher, but I have no idea what to put in the fields. (virtual host vs host - dunno my ports -..)

  2. Python; using Pika. I have a simple sender script which connects from my client to my server and sends a 'hello world' text to the server. Also wrote a receiver script to receive those 'hello world's. Is this a determination of load if I open multiple terminals and run my sender script 10 instances at the same time?

Again, I'm asking all these because I'm new to servers, cloud, load testing and Jmeter. It's just a task I have to do.

Thanks for any answer you can give me to clarify things a bit for me.


回答1:


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




回答2:


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



来源:https://stackoverflow.com/questions/34936348/how-do-i-load-test-a-rabbitmq-server-either-using-jmeter-python-or-any-other-t

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