Updated on 2024-07-31 GMT+08:00

Diagnosing Kafka Message Accumulation

Unprocessed messages accumulate if the client's consumption is slower than the server's sending. Accumulated messages cannot be consumed in time.

DMS for Kafka provides the message accumulation diagnosis function on the console. If there are accumulated messages, you can learn about the possible causes, affected partitions or brokers, and handling suggestions of the accumulation by viewing the diagnosis record.

Prerequisites

  • A Kafka instance has been created, and a consumer group is consuming messages in non-assign mode.
  • When a consumer group is being diagnosed, other consumer groups and other topics in the consumer group cannot be diagnosed.

Process Flow

Figure 1 Process of accumulation diagnosis

Step 1: Pre-check

  1. Log in to the console.
  2. Click in the upper left corner to select a region.

    Select the region where your Kafka instance is.

  3. Click and choose Middleware > Distributed Message Service (for Kafka) to open the console of DMS for Kafka.
  4. Click the desired Kafka instance to view the instance details.
  5. In the left navigation pane, choose Analysis & Diagnosis > Accumulation Diagnosis.
  6. Select the consumer groups and topics to be diagnosed, and click Pre-check.

    If the check is successful, the message "Pre-checked" is displayed in the upper part of the page, and the check results of the memory usage, CPU usage, partition subscription relationships, accumulated messages, and traffic burst are displayed.

    Figure 2 Pre-check

    If there is no risk shown in the Accumulated Messages area, message accumulation diagnosis cannot be performed. If there are any risks in the Accumulated Messages area and the consumer group is not consuming message in the assign mode, you can perform message accumulation diagnosis.

Step 2: Diagnosis

  1. Click Start Diagnosis. In the Diagnosis Records area, a record in the Diagnosing state is displayed.

    If the status changes to Successful, the diagnosis is complete.

  2. Locate the row that contains the target diagnosis record, and click View Details. The Diagnosis Details page is displayed.
  3. View the number of abnormal, failed, and normal items in the upper part of the page. In the Diagnosed Item area, click an abnormal item, such as Rebalancing, and view the possible causes, affected partitions or brokers, and handling suggestions.

    Figure 3 Diagnosis details