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

问题描述 投票:0回答:1

我对Spark来说比较新。我有一个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小时的跳跃?你会如何调查这样的问题?

amazon-web-services apache-spark amazon-emr
1个回答
2
投票

Spark失败后重试。您的流程失败了。发生这种情况时,所有活动任务都可能被视为失败,因此在群集中的其他位置重新排队。

© www.soinside.com 2019 - 2024. All rights reserved.