This topic describes common issues related to message accumulation.
How to handle message accumulation?
In addition to providing asynchronous decoupling, message queues handle frontend traffic spikes to ensure backend system stability. This requires the message queue to have a certain capacity for message accumulation. A message queue can support the accumulation of billions of messages without a significant drop in performance.
Problem description
On the Consumer Status page for a Group ID in the Message Queue console, the real-time message accumulation is higher than expected, and performance has dropped significantly.
Solution
If you encounter message accumulation and a significant drop in performance, perform the following steps:
In the Message Queue console, go to the View consumer status page to find the host IP address of the consumer instance with the message accumulation. Then, log on to the host or container.
Run one of the following commands to view the process ID (PID).
ps -ef |grep javajps -lm
Run the
jstack -l pid > /tmp/pid.jstackcommand to view the stack information.Run the
cat /tmp/pid.jstack|grep ConsumeMessageThread -A 10 --colorcommand to view information aboutConsumeMessageThread. Focus on the thread state and stack. The command output is shown in the following figure.
For more information about thread states, see the official Java documentation.
More information
If the performance issue caused by message accumulation persists after you perform these steps, you can submit a ticket for technical support. When you submit the ticket, include the following information:
The
heap.binfile. You can obtain this file by running thejmap -dump:format=b,file=heap.bin [pid]command. Then, run thegzip heap.bincommand to create a compressed package.Note[pid] is the process ID that you obtained in Step 2.
The
sofamq.loglocal log file from the consumer client where the message accumulation occurred.The version of the consumer client.