You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@kafka.apache.org by Dylan Martin <dm...@istreamplanet.com> on 2020/02/10 17:34:46 UTC

Why would all consumers pull from the same partition?

I have a cluster of 20'ish brokers.  One topic has 60'ish consumers and 100 partitions, but the consumers all seem to be hitting the same broker, which makes me think they're all hitting the same partition.

What would cause that?  I assume I've configured something wrong.

Thanks!

-Dylan

The information contained in this email message, and any attachment thereto, is confidential and may not be disclosed without the sender's express permission. If you are not the intended recipient or an employee or agent responsible for delivering this message to the intended recipient, you are hereby notified that you have received this message in error and that any review, dissemination, distribution or copying of this message, or any attachment thereto, in whole or in part, is strictly prohibited. If you have received this message in error, please immediately notify the sender by telephone, fax or email and delete the message and all of its attachments. Thank you.

Re: Why would all consumers pull from the same partition?

Posted by Piotr Smolinski <pi...@confluent.io>.
Could you share the evidence you have for this scenario? Which Kafka
version?

I would first identify the partition leader placing. Before Kafka 2.4 all
produce and consume requests
were against the leader. So if by any chance your leaders got located to
the same broker, then
this broker would have significantly more load.

On the other hand in Kafka you should expect your clients to keep
connections open to all the brokers.

Piotr

Re: Why would all consumers pull from the same partition?

Posted by Alex Woolford <al...@woolford.io>.
As Chandrajeet said, the default behavior is to hash on the key to assign
the message to a partition. You may be able to distribute the data more
evenly across the brokers by changing the partition strategy in the
producer. It *is* possible to change the default behavior to, say,
round-robin. That might be an option if per-key ordering isn't a
requirement.

On Mon, Feb 10, 2020 at 12:48 PM Dylan Martin <dm...@istreamplanet.com>
wrote:

>
> Oooh, that sounds like our situation.
>
> Is there a way to avoid this with kafka configuration?  My access to the
> messages and consumers is limited.
> ________________________________
> From: Chandrajeet Padhy <ch...@truefort.com>
> Sent: Monday, February 10, 2020 9:52 AM
> To: users@kafka.apache.org <us...@kafka.apache.org>
> Subject: RE: Why would all consumers pull from the same partition?
>
> [EXTERNAL E-MAIL]
>
> Partition is decided based on message record key. If it's same, it will
> hit the same partition.
>
> -----Original Message-----
> From: Dylan Martin <dm...@istreamplanet.com>
> Sent: Monday, February 10, 2020 12:35 PM
> To: users@kafka.apache.org
> Subject: Why would all consumers pull from the same partition?
>
> I have a cluster of 20'ish brokers.  One topic has 60'ish consumers and
> 100 partitions, but the consumers all seem to be hitting the same broker,
> which makes me think they're all hitting the same partition.
>
> What would cause that?  I assume I've configured something wrong.
>
> Thanks!
>
> -Dylan
>
> The information contained in this email message, and any attachment
> thereto, is confidential and may not be disclosed without the sender's
> express permission. If you are not the intended recipient or an employee or
> agent responsible for delivering this message to the intended recipient,
> you are hereby notified that you have received this message in error and
> that any review, dissemination, distribution or copying of this message, or
> any attachment thereto, in whole or in part, is strictly prohibited. If you
> have received this message in error, please immediately notify the sender
> by telephone, fax or email and delete the message and all of its
> attachments. Thank you.
>
> The information contained in this email message, and any attachment
> thereto, is confidential and may not be disclosed without the sender's
> express permission. If you are not the intended recipient or an employee or
> agent responsible for delivering this message to the intended recipient,
> you are hereby notified that you have received this message in error and
> that any review, dissemination, distribution or copying of this message, or
> any attachment thereto, in whole or in part, is strictly prohibited. If you
> have received this message in error, please immediately notify the sender
> by telephone, fax or email and delete the message and all of its
> attachments. Thank you.
>

Re: Why would all consumers pull from the same partition?

Posted by Dylan Martin <dm...@istreamplanet.com>.
Oooh, that sounds like our situation.

Is there a way to avoid this with kafka configuration?  My access to the messages and consumers is limited.
________________________________
From: Chandrajeet Padhy <ch...@truefort.com>
Sent: Monday, February 10, 2020 9:52 AM
To: users@kafka.apache.org <us...@kafka.apache.org>
Subject: RE: Why would all consumers pull from the same partition?

[EXTERNAL E-MAIL]

Partition is decided based on message record key. If it's same, it will hit the same partition.

-----Original Message-----
From: Dylan Martin <dm...@istreamplanet.com>
Sent: Monday, February 10, 2020 12:35 PM
To: users@kafka.apache.org
Subject: Why would all consumers pull from the same partition?

I have a cluster of 20'ish brokers.  One topic has 60'ish consumers and 100 partitions, but the consumers all seem to be hitting the same broker, which makes me think they're all hitting the same partition.

What would cause that?  I assume I've configured something wrong.

Thanks!

-Dylan

The information contained in this email message, and any attachment thereto, is confidential and may not be disclosed without the sender's express permission. If you are not the intended recipient or an employee or agent responsible for delivering this message to the intended recipient, you are hereby notified that you have received this message in error and that any review, dissemination, distribution or copying of this message, or any attachment thereto, in whole or in part, is strictly prohibited. If you have received this message in error, please immediately notify the sender by telephone, fax or email and delete the message and all of its attachments. Thank you.

The information contained in this email message, and any attachment thereto, is confidential and may not be disclosed without the sender's express permission. If you are not the intended recipient or an employee or agent responsible for delivering this message to the intended recipient, you are hereby notified that you have received this message in error and that any review, dissemination, distribution or copying of this message, or any attachment thereto, in whole or in part, is strictly prohibited. If you have received this message in error, please immediately notify the sender by telephone, fax or email and delete the message and all of its attachments. Thank you.

RE: Why would all consumers pull from the same partition?

Posted by Chandrajeet Padhy <ch...@truefort.com>.
Partition is decided based on message record key. If it's same, it will hit the same partition.

-----Original Message-----
From: Dylan Martin <dm...@istreamplanet.com> 
Sent: Monday, February 10, 2020 12:35 PM
To: users@kafka.apache.org
Subject: Why would all consumers pull from the same partition?

I have a cluster of 20'ish brokers.  One topic has 60'ish consumers and 100 partitions, but the consumers all seem to be hitting the same broker, which makes me think they're all hitting the same partition.

What would cause that?  I assume I've configured something wrong.

Thanks!

-Dylan

The information contained in this email message, and any attachment thereto, is confidential and may not be disclosed without the sender's express permission. If you are not the intended recipient or an employee or agent responsible for delivering this message to the intended recipient, you are hereby notified that you have received this message in error and that any review, dissemination, distribution or copying of this message, or any attachment thereto, in whole or in part, is strictly prohibited. If you have received this message in error, please immediately notify the sender by telephone, fax or email and delete the message and all of its attachments. Thank you.