RabbitMQ throughput test using PerfTest and Autoscaling
Tags: test, cloudcomputing, performance, rabbitmq
Published: 2022-04-16 20:00:21

---
title: RabbitMQ throughput test using PerfTest and Autoscaling
published: true
date: 2022-04-15 14:49:40 UTC
tags: test,cloudcomputing,performance,rabbitmq
canonical_url: 
---

 **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](https://rabbitmq.github.io/rabbitmq-perf-test/stable/htmlsingle/) 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 GitHub](https://github.com/rabbitmq/rabbitmq-perf-test/releases)or use Docker image.

Before you begin, [Provision a Messages for RabbitMQ](https://cloud.ibm.com/docs/messages-for-rabbitmq?topic=cloud-databases-provisioning)instance 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

![](https://cdn-images-1.medium.com/max/1024/1*zIZHcu0P4ooTU7mSi26QUw.png)
_Messages for RabbitMQ on IBM Cloud_

2. For the AMQPS endpoint,

1. Click on the **Overview ** tab
2. Scroll to the **Endpoints** section
3. Click on the **AMQPS**  tab.
4. Copy and save the  **endpoint**

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

```
export USERNAME=ibm_cloud_

export PASSWORD=<PASSWORD>
```

4. If you are using the Docker image, run the below command by replacing _<AMQPS\_ENDPOINT>_ 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.

5. 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
```

6. 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](https://rabbitmq.github.io/rabbitmq-perf-test/stable/htmlsingle/#basic-usage).

### 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

2. Enter the username and password that you saved earlier and click on  **Login**

![](https://cdn-images-1.medium.com/max/1024/1*FeGls_bku26HETSMhRq50A.png)

![](https://cdn-images-1.medium.com/max/1024/1*l7Z_f7SNhwzOOVJSoJ8g5g.png)
_RabbitMQ management console_

> To understand the management UI, I would recommend [Understand the Management interface](https://www.cloudamqp.com/blog/part3-rabbitmq-for-beginners_the-management-interface.html) 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

![](https://cdn-images-1.medium.com/max/1024/1*GDCPV3BvLM-ecThs1nIgmw.png)
_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](https://twitter.com/VidyasagarMSC) or on [LinkedIn](https://www.linkedin.com/in/vidyasagarmsc/).

### Further reading

- [Autoscaling considerations](https://cloud.ibm.com/docs/messages-for-rabbitmq?topic=messages-for-rabbitmq-autoscaling#autoscaling-consider)
- [Scaling Disk, Memory, and CPU](https://cloud.ibm.com/docs/messages-for-rabbitmq?topic=messages-for-rabbitmq-resources-scaling)
- [What’s new with RabbitMQ 3.9.x](https://github.com/rabbitmq/rabbitmq-server/discussions/3228)

* * *