Help Center> Distributed Message Service for RocketMQ> User Guide> Testing Instance Performance> Testing the Performance of RocketMQ 4.8.0 Instances
Updated on 2024-05-14 GMT+08:00

Testing the Performance of RocketMQ 4.8.0 Instances

Test Scenarios

This section covers performance tests on RocketMQ 4.8.0 instances by sending 1 KB messages with more than 80% CPU usage. The performance is measured by network inbound/outbound traffic, message production/consumption rate, CPU core load, and memory usage.

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

    Brokers

    Storage Space

    ACL

    Public Access

    rocketmq-01

    rocketmq.4u8g.cluster.small

    1

    High I/O | 300 GB

    Disabled

    Disabled

    rocketmq-02

    rocketmq.4u8g.cluster

    1

    High I/O | 300 GB

    Disabled

    Disabled

    rocketmq-03

    rocketmq.8u16g.cluster

    1

    High I/O | 300 GB

    Disabled

    Disabled

    rocketmq-04

    rocketmq.12u24g.cluster

    1

    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

    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 Consumer Group.
    Table 3 Consumer group parameters

    Name

    Broker

    Max. Retries

    Broadcast

    group-01

    broker-0

    16

    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}
  • Connection Address: obtained after purchasing a RocketMQ instance.
  • Topic Name: set during topic creation.
  • Message Size: 1 KB
  • Number of Producer Threads: When testing rocketmq.4u8g.cluster.small, rocketmq.4u8g.cluster, and rocketmq.8u16g.cluster, set the number to 256. When testing rocketmq.12u24g.cluster, set the number to 640.

Consumption command:

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

Test Result

Table 4 Test results

Metric

rocketmq.4u8g.cluster.small

rocketmq.4u8g.cluster

rocketmq.8u16g.cluster

rocketmq.12u24g.cluster

Message production rate

56,532 per second

62,443 per second

92,476 per second

138,369 per second

Message consumption rate

53,793 per second

60,106 per second

90,563 per second

116,154 per second

Inbound traffic

91 MB/s

99.64 MB/s

143.64 MB/s

238.19 MB/s

Outbound traffic

223 MB/s

314 MB/s

451 MB/s

674 MB/s

CPU usage

86%

90%

81%

81%

Average load per CPU core

2.77

3.03

1.73

1.73

Memory usage

63%

55%

49%

47%