Partitions consumed faster than others


I’ve been using alpakka kafka to streaming data from kafka topics. I’m using:

      .committableSource(consumerSettings, Subscriptions.topics(topic))

Recently I’ve tried to spam more consumers like 3 on a topic which has 15 partitions. When I plug more consumers with the same group id, it kindly split 5 partitions per consumer, but it seems to do not consume all partitions at the same time, it seems to read one by one, or read a specific partition much faster than others.

|Partition|LogSize|Consumer Offset|Lag|

Here is a real example of a production application I’m running. So I have some questions:

  • Is it ok to read some partitions much faster than others? Please, note that this behavior only happens when I start more than one consumer.
  • Should I change the way I’m consuming? Should I use source per partition, or is there a different option?

I appreciate any help, thanks!



I was suspecting that it could happen when plugging more than one consumer(read more than one application), but it happened today using only one consumer, you can see by taking a look at the consumer group, which is the same.

At the time it happened, I had 20MM of messages still waiting to be processed(lag). The above picture is a picture taken from the Kafka manager we have at the company.

A follow up here:

I have not seen this pattern in our usage so far, but I’d like to understand it as well.

When you say “plug more consumers”, what exactly do you mean? Are you

  • creating multiple Kafka sources, then merging them in a single graph?
  • creating multiple graphs in the same application?
  • running multiple instances of your application at the same time, one graph per instance?

Hi @schoeneu,

Sorry for the lack of clarity, but I meant running multiple instances of my application.

I have my application deployed on Kubernetes, 1 pod and 1 consumer only. At some point, I have increased the number of runnable containers by 2 or 3 to increase the message throughput.
When more pods get up and running, it’s possible to see more consumers using the same group Id being used and at the same time, some partitions start to being consumed faster than others.