在AWS Glue中运行python作业时,我会得到以下错误:
原因:因超过记忆限度而被纱线杀死的容器。使用5.6GB的5.5GB物理内存。考虑提高spark.yarn.executor.memoryOverhead
在脚本开头运行此命令时:
print '--- Before Conf --'
print 'spark.yarn.driver.memory', sc._conf.get('spark.yarn.driver.memory')
print 'spark.yarn.driver.cores', sc._conf.get('spark.yarn.driver.cores')
print 'spark.yarn.executor.memory', sc._conf.get('spark.yarn.executor.memory')
print 'spark.yarn.executor.cores', sc._conf.get('spark.yarn.executor.cores')
print "spark.yarn.executor.memoryOverhead", sc._conf.get("spark.yarn.executor.memoryOverhead")
print '--- Conf --'
sc._conf.setAll([('spark.yarn.executor.memory', '15G'),('spark.yarn.executor.memoryOverhead', '10G'),('spark.yarn.driver.cores','5'),('spark.yarn.executor.cores', '5'), ('spark.yarn.cores.max', '5'), ('spark.yarn.driver.memory','15G')])
print '--- After Conf ---'
print 'spark.driver.memory', sc._conf.get('spark.driver.memory')
print 'spark.driver.cores', sc._conf.get('spark.driver.cores')
print 'spark.executor.memory', sc._conf.get('spark.executor.memory')
print 'spark.executor.cores', sc._conf.get('spark.executor.cores')
print "spark.executor.memoryOverhead", sc._conf.get("spark.executor.memoryOverhead")
我得到以下输出:
spark.yarn.driver.memory无 spark.yarn.driver.cores无 spark.yarn.executor.memory无 spark.yarn.executor.cores无 spark.yarn.executor.memoryOverhead无 -之后 spark.yarn.driver.memory 15G spark.yarn.driver.cores 5 spark.yarn.executor.memory 15G spark.yarn.executor.cores 5 spark.yarn.executor.memoryOverhead 10G
spark.yarn.executor.memoryOverhead似乎已经设置好了,但是为什么它没有被识别呢?我还是会犯同样的错误。
我见过其他关于设置spark.yarn.executor.memoryOverhead的问题的帖子,但不是当它似乎被设置和不工作的时候吗?
发布于 2019-04-16 06:13:29
发布于 2018-08-29 06:38:50
不幸的是,当前版本的Glue不支持此功能。除了使用UI之外,您不能设置其他参数。在您的示例中,您可以使用AWS EMR服务,而不是使用AWS Glue。
当我遇到类似的问题时,我试图减少洗牌次数和数据量,并增加DPU。在关于这个问题的工作中,我基于以下文章。我希望它们是有用的。
http://blog.cloudera.com/blog/2015/03/how-to-tune-your-apache-spark-jobs-part-1/
更新: 2019-01-13
Amazon最近在AWS Glue文档中增加了新的部分,描述了如何监视和优化Glue作业。我认为了解与内存问题相关的问题在哪里以及如何避免它是非常有用的。
https://docs.aws.amazon.com/glue/latest/dg/monitor-profile-glue-job-cloudwatch-metrics.html
https://stackoverflow.com/questions/51986828
复制相似问题