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
- 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
For the AMQPS endpoint,
Click on the *Overview * tab
Scroll to the Endpoints section
Click on the AMQPS tab.
Copy and save the endpoint
Launch the terminal and run the below commands to set the username and password for AMQPS endpoint
export USERNAME=ibm_cloud_
export PASSWORD=<PASSWORD>
- 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>
Where x are the producers and y are the consumers. You can increase the throughput by increasing the number of producers over the consumers.
- 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
- 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
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.
- To launch the management console,
- Navigate to the Endpoints section of the Overview page,
- Click on the HTTPS tab
- Click on the Launch button
- Enter the username and password that you saved earlier and click on Login
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.
Top comments (0)