Help Center/ Distributed Message Service for RocketMQ/ User Guide/ Testing Instance Performance/ Testing Performance of RocketMQ 4.8.0 Instances (Basic Scenario)
Updated on 2026-01-26 GMT+08:00

Testing Performance of RocketMQ 4.8.0 Instances (Basic Scenario)

This section describes the production and consumption performance test of different flavors of RocketMQ 4.8.0 instances. The test is performed when 1 KB messages are sent, synchronously produced and consumed, and many messages are stacked.

Test Environment

Do as follows to set up the test environment:

  1. Buy instances as shown in Table 1. For details about how to buy an instance, see Buying a RocketMQ Instance.
    Table 1 Instance parameters

    Name

    Flavor

    Brokers

    Storage Space

    ACL

    Public Access

    SSL

    rocketmq-01

    rocketmq.4u8g.cluster.small

    1

    Ultra-high I/O 1,500 GB

    Enabled

    Disabled

    Disabled

    rocketmq-02

    rocketmq.4u8g.cluster

    1

    Ultra-high I/O 1,500 GB

    Enabled

    Disabled

    Disabled

    rocketmq-03

    rocketmq.8u16g.cluster

    1

    Ultra-high I/O 1,500 GB

    Enabled

    Disabled

    Disabled

    rocketmq-04

    rocketmq.12u24g.cluster

    1

    Ultra-high I/O 1,500 GB

    Enabled

    Disabled

    Disabled

    rocketmq-05

    rocketmq.16u32g.cluster

    1

    Ultra-high I/O 1,500 GB

    Enabled

    Disabled

    Disabled

  2. Create topics as shown in Table 2. For details about how to create topics, see Creating a RocketMQ Topic.
    Table 2 Topic parameters

    Name

    Permission

    Broker

    Queue

    topic-01

    Pub/Sub

    broker-0

    8

  3. Create a consumer group as shown in Table 3. For details about how to create a consumer group, see Creating a RocketMQ Consumer Group.
    Table 3 Consumer group parameters

    Name

    Broker

    Max. Retries

    Broadcast

    group-01

    broker-0

    16

    Disabled

  4. Create a user as shown in Table 4. For details, see Configuring RocketMQ ACL Users.
    Table 4 User parameters

    Name

    Administrator

    Default Topic Permissions

    Default Consumer Group Permissions

    Secret Key

    test

    Disabled

    Publish/Subscribe

    Subscribe

    Custom

  5. Buy a Linux ECS (with the same region, AZ, VPC, subnet, and security group as the RocketMQ instance). For details about how to purchase an ECS, see Purchasing a Custom ECS.
  6. Install Java JDK on the ECS and configure the environment variables JAVA_HOME and PATH.
    export JAVA_HOME=/root/jdk1.8.0_231 
    export PATH=$JAVA_HOME/bin:$PATH
  7. Download the benchmark suite.
    wget https://dist.apache.org/repos/dist/release/rocketmq/5.1.4/rocketmq-all-5.1.4-bin-release.zip
  8. Decompress the benchmark suite.
    unzip rocketmq-all-5.1.4-bin-release.zip

Test Commands

Production command:

Run the following command in the benchmark folder:

sh producer.sh -n "${Connection address}" -t ${Topic name} -s ${Message size} -w ${Number of producer threads} -a true -ak ${ACL username} -sk ${ACL key}

In the preceding command, -a true indicates that ACL is enabled.

Table 5 Message production parameters

Parameter

Description

Example Value

Connection address

Connection address of a RocketMQ instance. Obtain the address from the Connection area on the Overview page of the instance.

192.168.111.182:8100;192.168.111.14:8100

Topic name

Name of a topic created in the RocketMQ instance, which is obtained from Table 2.

topic-01

Message size

The message size is custom.

The maximum message size supported by RocketMQ is 4 MB.

1024 (1 KB)

Number of producer threads

Number of producer threads.

128

ACL username

Name of the user. It can be obtained from Table 4.

test

ACL key

Key of the user. It can be obtained from Table 4.

XXXXXXXX

Run the following command with the values obtained in Table 1 to produce a message:

sh producer.sh -n "192.168.111.182:8100;192.168.111.14:8100" -t topic-01 -s 1024 -w 128 -a true -ak test -sk XXXXXXXX

Consumption command:

Run the following command in the benchmark folder:

sh consumer.sh -n "${Connection address}" -t ${Topic name} -g ${Consumer group name} -a true -ak ${ACL username} -sk ${ACL key}
Table 6 Message consumption parameters

Parameter

Description

Example Value

Connection address

Connection address of a RocketMQ instance. Obtain the address from the Connection area on the Overview page of the instance.

192.168.111.182:8100;192.168.111.14:8100

Topic name

Name of a topic created in the RocketMQ instance, which is obtained from Table 2.

topic-01

Consumer group name

Name of a consumer group created in the RocketMQ instance, which is obtained from Table 3.

group-01

ACL username

Name of the user. It can be obtained from Table 4.

test

ACL key

Key of the user. It can be obtained from Table 4.

XXXXXXXX

Run the following command with the values obtained in Table 6 to consume messages:

sh consumer.sh -n "192.168.111.182:8100;192.168.111.14:8100" -t topic-01 -g group-01 -a true -ak test -sk XXXXXXXX

Procedure

  1. Start the production and consumption commands at the same time.
  2. Stop the consumption command 1 minute later and wait for at least 100 GB messages to be produced.
  3. Start the consumption command again to test the production and consumption performance in a cold read scenario.

Test Result Reference

The following performance data is of RocketMQ clusters tested based on the benchmark conditions (disk type: ultra-high I/O; message size: 1 KB; cold read scenario). The actual performance is affected by multiple factors including but not limited to the disk type, cold read, cold read concurrency, SSL encryption, ACL, message trace, cross-AZ, production concurrency, and queue traffic distribution. Therefore, you are advised to monitor instances by referring to Configuring RocketMQ Alarms and expand the capacity before the instance performance is insufficient due to service growth.

Table 7 Test result reference (basic scenario)

Metric

rocketmq.4u8g.cluster.small

rocketmq.4u8g.cluster

rocketmq.8u16g.cluster

rocketmq.12u24g.cluster

rocketmq.16u32g.cluster

Message production rate

28,566 per second

31,644 per second

43,272 per second

44,934 per second

42,380 per second

Message consumption rate

99,826 per second

104,949 per second

210,195 per second

219,311 per second

197,813 per second

Inbound traffic

68 MB/s

75 MB/s

115 MB/s

109 MB/s

96 MB/s

Outbound traffic

240 MB/s

251 MB/s

460 MB/s

400 MB/s

371 MB/s

CPU usage

98%

97%

89%

89%

90%

Average load per CPU core

4.07

3.61

2.25

2.32

2.83

Memory usage

46%

44%

49%

49%

48%