All Products
Search
Document Center

ApsaraMQ for Kafka:Why do partitions in the same consumer group show different consumption progress?

Last Updated:Mar 11, 2026

Consumers in the same group consume messages at different rates across partitions -- some partitions lag behind others. This typically happens when the partition count is not evenly divisible by the number of consumers, causing an unbalanced workload distribution.

Diagnose the issue

  1. Log on to the ApsaraMQ for Kafka console.

  2. On the Groups page, click the name of the target group.

  3. On the Group Details page, click the Consumer Status tab.

  4. In the Actions column of the target topic, click Consumer Details.

  5. Compare the Maximum Offset values across partitions. A partition with a significantly higher Maximum Offset received messages from the producer earlier, indicating uneven consumption progress.

Root cause

ApsaraMQ for Kafka assigns partitions to consumers within a group as evenly as possible. When the partition count divides evenly by the consumer count, each consumer handles the same number of partitions. When it does not, some consumers are assigned more partitions than others and process messages more slowly.

Example: A topic has 12 partitions and a consumer group has 5 consumers. The partitions are distributed as follows:

ConsumerAssigned partitions
Consumer 13
Consumer 23
Consumer 32
Consumer 42
Consumer 52

If all five consumers have the same processing capacity, Consumer 1 and Consumer 2 fall behind because they handle 50% more partitions than the others.

Note

The default partition count is 12 for subscription and pay-as-you-go ApsaraMQ for Kafka instances, and 3 for serverless instances.

Solution

Align the partition count with the consumer count

Make sure the partition count is evenly divisible by the consumer count.

Partition countConsumer count options (even distribution)
12 (default)1, 2, 3, 4, 6, or 12
3 (serverless default)1 or 3

For example, with 12 partitions, use 3, 4, 6, or 12 consumers -- not 5, 7, or 8.

Additional considerations

  • Unequal processing capacity: Even with an evenly divisible partition-to-consumer ratio, lag can appear if individual consumers differ in processing speed -- for example, due to network latency, resource constraints, or slow downstream dependencies. Monitor per-consumer throughput to identify bottlenecks.

  • Monitor consumer group lag: Track the consumer group lag metric (the difference between the latest produced offset and the committed consumer offset for each partition) to detect imbalances proactively.