Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

how many consumer groups can a kafka topic handle?

suppose I have a kafka topic with say about 10 partitions, I understand that every consumer group should have 10 consumers reading from the topic at any given time to achieve maximum paralellism.

However, I wanted to know if there is any direct rule also for the number of consumer groups a topic can handle at any given point of time. (I was asked this in an interview recently). According to my best knowledge, it depends on the configuration of the broker so as to which how many connections it can handle at any given point of time.

However, just wanted to know how many maximum consumer groups (each with 10 consumers) can be scaled at a given point of time?

like image 751
mythic Avatar asked Jul 08 '19 16:07

mythic


People also ask

How many consumer groups can Kafka handle?

While Kafka allows only one consumer per topic partition, there may be multiple consumer groups reading from the same partition.

Can Kafka topic have multiple consumer groups?

So the rule in Kafka is only one consumer in a consumer group can be assigned to consume messages from a partition in a topic and hence multiple Kafka consumers from a consumer group can not read the same message from a partition.

How many consumer groups are there?

20-25 consumer groups are well organized and recognized for their work.

Is Kafka consumer group per topic?

Kafka Consumer Groups A consumer group has a unique id. Each consumer group is a subscriber to one or more Kafka topics. Each consumer group maintains its offset per topic partition. If you need multiple subscribers, then you have multiple consumer groups.


2 Answers

In Kafka, there is no explicit limit on the number of consumer groups that can be instantiated for a particular topic. However, you should be aware that the more the consumer groups, the bigger the impact on network utilisation.

like image 159
Giorgos Myrianthous Avatar answered Oct 20 '22 01:10

Giorgos Myrianthous


As it was said above, up to few thousands, should be okay. For those who will land here (like me) wondering about many thousands of connections (e.g connecting IoT devices directly to kafka), it seems that kafka wasn't designed for that, at least according to this blog.

not built for tens of thousands

like image 30
ozma Avatar answered Oct 20 '22 01:10

ozma