Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

events distribution in kafka partitions #271

Open
galactus009 opened this issue Jun 13, 2019 · 4 comments
Open

events distribution in kafka partitions #271

galactus009 opened this issue Jun 13, 2019 · 4 comments
Labels
help wanted Need help from users

Comments

@galactus009
Copy link

galactus009 commented Jun 13, 2019

Hello

We are having unequal events distribution of events in the partitions. our topic have 8 partitions we are noticing that one of the partition getting bulk of the events others paritions are getting very less. please advise.

Below is our fluentd-kafka-output config

<store>
  @type kafka_buffered
   	 brokers broker1:9092,broker2:9092,broker3:9092 
       default_topic MyTopic
       output_data_type msgpack
       output_include_tag true
       get_kafka_client_log false
       buffer_type file
       buffer_path /tmp/td-agent/buffer
       flush_interval 3s
       required_acks 1
       num_threads 8
</store>
@galactus009
Copy link
Author

Any guidance is appreciated

@repeatedly
Copy link
Member

https://github.com/zendesk/ruby-kafka/blob/master/lib/kafka/partitioner.rb

Here is an implementation of partitioner.
I'm not sure why rand returns wrong distribution. One approach is specify partition_key or partition_key_key to use value based distribution.

@punneng
Copy link

punneng commented Jun 28, 2019

It somehow parses message_key and partition_key as empty string which supposed to be nil
Since message_key and partition_key are empty string then it doesnt go through rand(partition_count) condition.

im investigating and update or open a PR after I figure out why setting

default_partition_key "#{ENV['FLUENT_KAFKA_DEFAULT_PARTITION_KEY'] || nil}"
default_message_key "#{ENV['FLUENT_KAFKA_DEFAULT_MESSAGE_KEY'] || nil}"

parses default_partition_key and default_message_key as empty string.

hope it helps.

@github-actions
Copy link

github-actions bot commented Jul 6, 2021

This issue has been automatically marked as stale because it has been open 90 days with no activity. Remove stale label or comment or this issue will be closed in 30 days

@github-actions github-actions bot added the stale label Jul 6, 2021
@kenhys kenhys added the help wanted Need help from users label Jul 7, 2021
@github-actions github-actions bot removed the stale label Jul 7, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Need help from users
Projects
None yet
Development

No branches or pull requests

4 participants