使用KAFKA处理时间不稳定的Spark流式传输从一开始

时间:2017-12-05 11:16:33

标签: apache-kafka spark-streaming

我通过mapWithState func提交火花流工作来计算网站页面UV,完成批次从开始就有非常不稳定的处理时间。

enter image description here

那些批次(> 45s)在工作的第一阶段花了很长时间。但第一阶段只包括来自kafka经纪人(CreateDirectStream)和简单map的接收消息以供测试。

stream
  .map(
  x => {
      Tuple2[String,Tuple3[Int,HLL,String]](getMd5(0.0 + ";" + getFormatDate(1600000000l) + ";" +"1;1;1;1;1;1;1;1;1;1;1;1"),Tuple3(1, hyperLogLog(getMd5("1").getBytes(Charsets.UTF_8)), "0.0" + ";" + getFormatDate(1600000000l) + ";" +"1;1;1;1;1;1;1;1;1;1;1;1"))
  })

enter image description here

我不知道为什么有些批次需要40多秒才能完成。卡夫卡是否接受了不稳定? Kafka和Spark在局域网中。

0 个答案:

没有答案