Spark Streaming时间间隔性能测试

SparkStreaming能支持的最短时间间隔取决于数据源产生的速度,及对RDD的操作。本文针对同一数据源(日志由spark实时收集),测试RDD几种操作对应的合适的时间间隔。时间间隔time以如下形式作用于spark streaming:
new StreamingContext(sparkConf, Milliseconds(time.toLong))

测试数据源: log data with speed 100G/d
测试用例:对RDD基本操作print,log收集至hdfs,对log进行filter/map/reduce/write hdfs

结论:
如 果只是类似于RDD.print()的简单操作,时间间隔最小可到5ms级别。对RDD的操作越复杂,写hdfs的数据量越大,最小时间间隔就需要越长; 否则会出现越来越多的作业被拖延,并且delay的时间越来越长。有趣的是,相比于RDD map reduce,写hdfs对时间间隔影响更大。
最合理的时间间隔应该是,足够恰好处理完job,job total delay整体趋于平稳(可有波动),而不是持续增长。

App running time: 20mins左右
Time interval Action Total Delay(s) Status(stable?)
Just print:


100ms RDD.print() 0.002 - 0.004 Y
50ms RDD.print() 0.001 - 0.003 Y
30ms RDD.print() 0.002 - 0.007 Y
10ms RDD.print() 0.001 - 0.00* T
5ms RDD.print() 0.002 - 0.01*  Y
3ms RDD.print() 0.001 - 157.889 - ... N
Save to hdfs:



100ms save all data to hdfs 0.002 - 221.* - 0.*** Y
Influnced by other higher priority app submittion
50ms save all data to hdfs
0.006 - 78.825 - 0.002  Y
40ms save all data to hdfs 0.00* - 0.1** Y
30ms save all data to hdfs 0.00* - 386.981(20mins) N
filter/map/reduce/write hdfs


100ms count start/fail/succ and save result to hdfs
0.00* - 0.1** Y
50ms count start/fail/succ and save result to hdfs 0.00* - 0.1**(23mins) Y
30ms count start/fail/succ and save result to hdfs 0.001 - 0.1**(25mins) Y
10ms count start/fail/succ and save result to hdfs 0.001 - 0.1**(25mins) Y
5ms count start/fail/succ and save result to hdfs 0.00*- 12.*** - 0.*** - 62.780(20mins) N
3ms count start/fail/succ and save result to hdfs 0.00* - 310.708(20mins) N

你可能感兴趣的:(Spark Streaming时间间隔性能测试)