Updated on 2024-05-14 GMT+08:00

Testing the Performance of RocketMQ 5.x Instances

Test Scenarios

This section covers performance tests on RocketMQ 5.x instances by sending 1 KB messages. The performance is measured by message production/consumption rate and average production latency.

Test Environment

Perform the following steps to set up the test environment:

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

    Name

    Flavor

    Storage Space

    ACL

    Public Access

    rocketmq-01

    rocketmq.b2.large.4

    Ultra-high I/O | 300 GB

    Disabled

    Disabled

    rocketmq-02

    rocketmq.b2.large.8

    Ultra-high I/O | 300 GB

    Disabled

    Disabled

    rocketmq-03

    rocketmq.b2.large.12

    Ultra-high I/O | 300 GB

    Disabled

    Disabled

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

    Name

    Message Type

    topic-01

    Normal

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

    Name

    Max. Retries

    Broadcast

    Orderly

    group-01

    16

    Disabled

    Disabled

  4. 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 an ECS.
  5. Install Java JDK and configure the environment variables JAVA_HOME and PATH on the ECS.
    export JAVA_HOME=/root/jdk1.8.0_231 
    export PATH=$JAVA_HOME/bin:$PATH
  6. Download the benchmark suite.
    wget https://dist.apache.org/repos/dist/release/rocketmq/5.1.4/rocketmq-all-5.1.4-bin-release.zip
  7. Decompress the benchmark suite.
    unzip rocketmq-all-5.1.4-bin-release.zip

Test Commands

Production command:

sh producer.sh -n "${Connection Address}" -t ${Topic Name} -s ${Message Size} -w ${Number of Producer Threads}

Consumption command:

sh mqadmin consumeMessage -n "${Connection Address}" -t ${Topic Name} -g ${Consumer Group Name}

Test Result

Table 4 Test results

Metric

rocketmq.b2.large.4

rocketmq.b2.large.8

rocketmq.b2.large.12

Production rate

1,008.500/s

2,019.710/s

3,011.640/s

Consumption rate

1,008.520/s

2,019.710/s

3,010.590/s

Average production latency

26.336 ms

8.788 ms

5.876 ms