[ 
https://issues.apache.org/jira/browse/FLINK-35210?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17839756#comment-17839756
 ] 

Nicolas Perrin commented on FLINK-35210:
----------------------------------------

That's indeed how I proceeded in our case.

 I'm sorry, my choice of words was a bit confusing.

We are running a Flink job on EMR and we had a lot of issues where some task 
instances would be randomly killed. From what we understood, one of the reason 
was that we used a Flink parallelism for the application equals to a multiple 
of the number of instances. So some of the task instances could end up reading 
one or more partitions while some others would read nothing while having the 
dedicated resources. This behaviour was amplified by the fact that we've got 
several kafka sources.
It appeared to us that this was a source of instability, so we ended up forcing 
the parallelism of the source operator to the number of kafka partitions.

> Give the option to set automatically the parallelism of the KafkaSource to 
> the number of kafka partitions
> ---------------------------------------------------------------------------------------------------------
>
>                 Key: FLINK-35210
>                 URL: https://issues.apache.org/jira/browse/FLINK-35210
>             Project: Flink
>          Issue Type: Improvement
>          Components: Connectors / Kafka
>            Reporter: Nicolas Perrin
>            Priority: Minor
>
> Currently the setting of the `KafkaSource` Flink's operator parallelism needs 
> to be manually chosen which can leads to highly skewed tasks if the developer 
> doesn't do this job.
> To avoid this issue, I propose to:
> -  retrieve dynamically the number of partitions of the topic using 
> `KafkaConsumer.
> partitionsFor(topic).size()`,
> - set the parallelism of the stream built from the source based on this value.
>  This way there won't be any idle tasks.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to