开发者社区> 问答> 正文

EMR上的Spark工作突然耗时30小时(从5小时起)

我有一个Spark作业,它运行在1个主服务器和8个核心的Amazon EMR集群上。简而言之,Spark作业从S3读取一些.csv文件,将它们转换为RDD,在RDD上执行一些相对复杂的连接,最后在S3上生成其他.csv文件。这项工作在EMR集群上执行,过去大约需要5个小时。突然有一天,它开始花费超过30个小时。输入(S3文件)没有明显差异。

我已经检查了日志,并且在漫长的运行中(30小时)我可以看到有关OutOfMemory错误的信息:

java.lang.OutOfMemoryError: Java heap space

    at java.util.IdentityHashMap.resize(IdentityHashMap.java:472)
    at java.util.IdentityHashMap.put(IdentityHashMap.java:441)
    at org.apache.spark.util.SizeEstimator$SearchState.enqueue(SizeEstimator.scala:174)
    at org.apache.spark.util.SizeEstimator$$anonfun$visitSingleObject$1.apply(SizeEstimator.scala:225)
    at org.apache.spark.util.SizeEstimator$$anonfun$visitSingleObject$1.apply(SizeEstimator.scala:224)
    at scala.collection.immutable.List.foreach(List.scala:381)
    at org.apache.spark.util.SizeEstimator$.visitSingleObject(SizeEstimator.scala:224)
    at org.apache.spark.util.SizeEstimator$.org$apache$spark$util$SizeEstimator$$estimate(SizeEstimator.scala:201)
    at org.apache.spark.util.SizeEstimator$.estimate(SizeEstimator.scala:69)

....

    at org.apache.spark.broadcast.TorrentBroadcast._value(TorrentBroadcast.scala:66)
    at org.apache.spark.broadcast.TorrentBroadcast.getValue(TorrentBroadcast.scala:96)
    at org.apache.spark.broadcast.Broadcast.value(Broadcast.scala:70)

尽管有明显的OutOfMemory异常,但输出(S3文件)看起来还不错,所以很明显Spark工作正常完成。

什么可以突然产生从5小时执行到30小时的跳跃?

展开
收起
小六码奴 2019-04-22 14:34:43 1857 0
1 条回答
写回答
取消 提交回答
  • Spark失败后重试。你的流程失败了。发生这种情况时,所有活动任务都可能被视为失败,因此在群集中的其他位置重新排队。

    2019-07-17 23:33:58
    赞同 展开评论 打赏
问答排行榜
最热
最新

相关电子书

更多
Hybrid Cloud and Apache Spark 立即下载
Scalable Deep Learning on Spark 立即下载
Comparison of Spark SQL with Hive 立即下载