You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@flink.apache.org by Александр Сергеенко <al...@gmail.com> on 2021/08/17 14:36:45 UTC

Flink Kafka Consumer perfomance dramatically increases while someone's publishing to the consuming topic

Hi Community!

     I'm observing a strange behavior while using Flink Kafka Consumer.
     We have a Kafka topic that is splitted into 20 partitions used to
process some secondary metrics. The topic is consuming by a Consumer and
usually, it has a lag of about 5 to 7 million events. If someone (a
Producer) publishing new events to the topic, the consumption rate on
Consumer increases up to 1500 events per second. When there are no messages
publishing to the topic, but the lag is still there, Consumer rates drop to
400-500 events per second and remain the same until the Producer starts
publishing.
     Here is a picture of what is happening:

[image: Untitled Diagram (1).png]
   I will appreciate any possible suggestions.

   Thanks,
    Alex Sergeenko

Re: Flink Kafka Consumer perfomance dramatically increases while someone's publishing to the consuming topic

Posted by Arvid Heise <ar...@apache.org>.
Hi Alex,

I don't have an obvious idea.

First I'd check if this drop can also be observed without Flink. You could
consume on a terminal (potentially in parallel where each terminal is
subscribed to one partition). See if there is a difference.
Is it observable over a longer duration? Maybe Kafka is doing house
keeping?

Second, I'd suggest to look at broker metrics. I could imagine that in the
second case, the segments are all cold and reside on disks and need to be
fetched from disk while in the first case they are hot and fetched from
memory?

Third, I'd play around with Kafka consumer metrics.

I don't see any particular way how Flink or Flink-Kafka-connector can
exhibit that behavior.

On Tue, Aug 17, 2021 at 4:37 PM Александр Сергеенко <
aleksandr.sergeenko@gmail.com> wrote:

>
> Hi Community!
>
>      I'm observing a strange behavior while using Flink Kafka Consumer.
>      We have a Kafka topic that is splitted into 20 partitions used to
> process some secondary metrics. The topic is consuming by a Consumer and
> usually, it has a lag of about 5 to 7 million events. If someone (a
> Producer) publishing new events to the topic, the consumption rate on
> Consumer increases up to 1500 events per second. When there are no messages
> publishing to the topic, but the lag is still there, Consumer rates drop to
> 400-500 events per second and remain the same until the Producer starts
> publishing.
>      Here is a picture of what is happening:
>
> [image: Untitled Diagram (1).png]
>    I will appreciate any possible suggestions.
>
>    Thanks,
>     Alex Sergeenko
>
>
>