Bad Perf with Sliding Windows in Flink

Viewed 320

I use this code to perform my test (Flink Quick Start):

 val text = env.socketTextStream("localhost", port, '\n')

    // parse the data, group it, window it, and aggregate the counts
    val windowCounts = text
        .flatMap { w => w.split("\\s") }
        .map { w => WordWithCount(w, 1) }
        .keyBy("word")
        .timeWindow(Time.minute(15))
        .sum("count")

With this Code I have more than 65 000 input / seconde

If I change

timeWindow(Time.minute(15))

By

timeWindow(Time.minutes(15), Time.seconds(1))

I have less than 2 500 input / seconde

Is there any way to have better Performance with Sliding Windows ?

1 Answers
Related