Scenario
In RocketMQ, a dialing test, also known as a performance test or stress test, is a common method for evaluating system performance and capacity. It helps to understand how RocketMQ performs under different loads, identify system bottlenecks and optimize performance. The following shows the common scenarios of dialing test:
l Producer performance dialing test: By simulating a large number of producers that send messages simultaneously, you can test RocketMQ's message throughput and latency under heavy loads. You can adjust parameters such as the number of concurrent producers, message size, and send rate to observe RocketMQ performance and identify performance bottlenecks.
l Consumer performance dialing test: By simulating a large number of consumers that consume messages simultaneously, you can test RocketMQ's message processing capability and consumption latency under heavy loads. You can adjust parameters such as the number of concurrent consumers, message processing logic, and consumption rate to observe RocketMQ's performance and identify performance bottlenecks.
You need to set proper parameters based on actual requirements and scenarios to perform adequate testing and evaluation. You also need to ensure that resource consumption and system load during dialing test do not have an irreversible impact on the production environment.
Procedure
1. On the eSurfing Cloud official website, click Control Center and select RocketMQ.
2. Log in to the DMS RocketMQ console and click Region in the upper right corner to select the corresponding resource pool.
Go to the instance list and click Manage to enter the management menu.
3. Go to the instance list and click Manage to enter the management menu.
4. Go to the topic management menu. Click Dialing Test to perform a production and consumption dialing test, and verify the activated message instances and topics.
(1) Production dialing test:
l Select the message type. By default, normal messages are selected.
l Enter the number of test messages to be generated and the size of each message. Each message is 1KB by default. You are not advised to set the size to greater than 4MB (4,096KB).
l Select an existing message topic. If there is no topic, create a new topic. For details, see Creating Topics and Subscription Groups.
l Click Test to generate test message data based on the entered specifications and number. The information of the message data is displayed, including message ID, sending status, topic name, broker name, and queue ID.
The dialing test function involves the status codes for message sending, which are explained as follows:
² SEND_OK: Indicates that messages are successfully sent to the message server.
² FLUSH_DISK_TIMEOUT: Indicates that messages are successfully sent to the message server, but disk flushing timed out. If the message server crashes, data that has not been persisted to disks may be lost.
² FLUSH_SLAVE_TIMEOUT: Indicates that messages are successfully sent to the message server, but slave server flushing timed out. This may cause inconsistency in master/slave synchronization.
² SLAVE_NOT_AVAILABLE: Indicates that messages are successfully sent to the message server, but the slave server is unavailable. The failure may be caused by a network problem or a server crash.
² UNKNOWN_ERROR: Indicates that an unknown error occurred during message sending. In this case, it is recommended to re-send messages.
² MESSAGE_SIZE_EXCEEDED: Indicates that the message size exceeds the limit allowed by the message server. You need to check the message size.
² PRODUCE_THROTTLE: Indicates that the message sending frequency of the producer exceeds the limit allowed by the message server. This may be caused by messages sent too frequently.
² SERVICE_NOT_AVAILABLE: Indicates that the message server is unavailable. The failure may be caused by a network problem or message server crash.
Note: The status codes apply only to the message sending phase of RocketMQ and do not indicate that a message is successfully received by the consumer. Meanwhile, these status codes may vary for different versions. You can consult official documentation for the latest information.
(2) Consumption dialing test:
l Choose unordered/ordered messages from the drop-down menu. Unordered messages are selected by default.
RocketMQ is an open-source distributed message middleware that supports unordered and ordered messages.
² Ordered messages are those that are consumed in the exact order as they are sent. In certain business scenarios, messages must be processed sequentially, such as order processing or task execution. RocketMQ supports ordered messages and ensures that messages are consumed in the specified order by specifying order properties or using partitions of message queues.
² Unordered messages are those that are consumed regardless of the order in which they are sent. Unordered messages are characterized by high throughput and low latency, and apply to service scenarios requiring no strict sequence, such as log collection.
In RocketMQ, ordered and unordered messages are implemented slightly differently. Ordered messages are implemented using the partitioning mechanism of the message queue and the sequential message consumption on consumers. Unordered messages are realized through concurrent sending and receiving of messages.
To sum up, RocketMQ supports both ordered and unordered messages. You can select a proper message type based on business requirements.
l Currently, you can only choose the pull consumption method. RocketMQ also provides the push consumption mode in which the message queue server proactively pushes messages to consumers. Currently, only the pull consumption mode is available.
l Enter the consumption quantity.
l In the drop-down list, select an existing topic and subscription group. If there is no topic or subscription group, create a new one. For details, see Creating Topics and Subscription Groups.
l Click Test to generate consumption data based on the entered specifications and number. The information of the message data is displayed, including the message ID, topic name, generation time, storage time, queue ID, and consumption status.
The dialing test function involves message consumption status codes that are used to identify the consumption results during message consumption. The following shows the common consumption status codes of RocketMQ:
² CONSUME_SUCCESS: Indicates that a message is successfully consumed.
² RECONSUME_LATER: Indicates that a message fails to be consumed and needs to be re-consumed later.
² CONSUME_FAILURE: Indicates that a message has an error in consumption or fails to be consumed.
² SLAVE_NOT_AVAILABLE: Indicates that consumers cannot access the slave node to consume messages.
² NO_MATCHED_MESSAGE: Indicates that no matched messages can be consumed.
² OFFSET_ILLEGAL: Indicates that the offset parameter of consumption is invalid.
BROKER_TIMEOUT: Indicates that consumption failed due to broker timeout.