DEV Community

Vidyasagar SC Machupalli
Vidyasagar SC Machupalli

Posted on • Originally published at Medium on

RabbitMQ throughput test using PerfTest and Autoscaling

Learn how to test the performance of your RabbitMQ instance using PerfTest and enable autoscale to add more resources to the deployment based on your usage.

Introduction to the PerfTest tool

RabbitMQ perfTest is a throughput test tool used to test the performance of your RabbitMQ deployment on cloud or on-premises. The tool is a Java-based client to run and simulate the basic or advanced workloads.

You can either download a binary build from the RabbitMQ perfTest releases GitHubor use Docker image.

Before you begin, Provision a Messages for RabbitMQinstance on IBM Cloud following the instructions.

Run the perf test

  1. Before running the PerfTest, from the Messages for RabbitMQ service credentials page, copy and save the username and password


Messages for RabbitMQ on IBM Cloud

  1. For the AMQPS endpoint,

  2. Click on the *Overview * tab

  3. Scroll to the Endpoints section

  4. Click on the AMQPS tab.

  5. Copy and save the endpoint

  6. Launch the terminal and run the below commands to set the username and password for AMQPS endpoint

export USERNAME=ibm_cloud_

export PASSWORD=<PASSWORD>
Enter fullscreen mode Exit fullscreen mode
  1. If you are using the Docker image, run the below command by replacing with your endpoint.
docker run -it — rm pivotalrabbitmq/perf-test:latest -x 10 -y 5 — uri <AMQPS_ENDPOINT>
Enter fullscreen mode Exit fullscreen mode

Where x are the producers and y are the consumers. You can increase the throughput by increasing the number of producers over the consumers.

  1. If you downloaded the binary build, navigate to the extracted folder on your machine and run the below command
bin/runjava com.rabbitmq.perf.PerfTest -x 20 -y 5 — uri <AMQPS_ENDPOINT> -f persistent — rate 5000 — consumer-rate 1000
Enter fullscreen mode Exit fullscreen mode
  1. The PerfTest tool provides options for slower startup time and higher memory consumption. The defaults for — body-count and — body-field-count are usually fine, but can be increased for more randomness.
bin/runjava com.rabbitmq.perf.PerfTest — uri <AMQPS_ENDPOINT> — json-body — body-count 50000 — size 100000
Enter fullscreen mode Exit fullscreen mode

For example, bin/runjava com.rabbitmq.perf.PerfTest — uri amqps://$USERNAME1:$PASSWORD@cf11ab74–46c2–44a3-a3dd-9204d7396e6d.c7dvrhud08vgdqo60090.databases.appdomain.cloud:30411 — json-body — body-count 50000 — size 100000

For all the other parameters, check the basic usage section of the PerfTest documentation.

RabbitMQ Management console

The RabbitMQ Management UI is a browser-based interface that let you monitor RabbitMQ instance . You can monitor message rates.

  1. To launch the management console,
  • Navigate to the Endpoints section of the Overview page,
  • Click on the HTTPS tab
  • Click on the Launch button
  1. Enter the username and password that you saved earlier and click on Login


RabbitMQ management console

To understand the management UI, I would recommend Understand the Management interface that gives a complete overview of the console.

Autoscaling

You can either manually adjust the amount of resources available to your IBM Cloud Messages for RabbitMQ deployment to suit your workload and the size of your data or set your deployment to autoscale disk, RAM, or both.

Navigate to the resources tab of the service to enable autoscaling based on your usage. here’s an example


Autoscaling your RabbitMQ deployment

Conclusion

In this post, you learned how to use the RabbitMQ PerfTest tool to run throughput and load tests on your IBM Cloud Messages for RabbitMQ deployment. The tool can be used with any RabbitMQ instance deployed on any cloud or on-premises. You also understood on how to scale your deployment based on the load and usage.

If you have any queries, feel free to reach out to me on Twitter or on LinkedIn.

Further reading


Latest comments (0)