【发布时间】:2017-09-13 15:24:43
【问题描述】:
我使用此代码执行我的测试 (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")
使用此代码,我有超过 65 000 次输入/秒
如果我改变了
timeWindow(Time.minute(15))
由
timeWindow(Time.minutes(15), Time.seconds(1))
我的输入/秒数少于 2 500
有什么方法可以让滑动窗口获得更好的性能?
【问题讨论】:
标签: scala apache-flink flink-streaming