繁体   English   中英

AWS Glue - 无法设置 spark.yarn.executor.memoryOverhead

[英]AWS Glue - can't set spark.yarn.executor.memoryOverhead

在 AWS Glue 中运行 python 作业时,出现错误:

原因:容器因超出内存限制而被 YARN 杀死。 使用了 5.6 GB 的 5.5 GB 物理内存。 考虑提升 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 问题的帖子,但在它似乎已设置但不起作用时却没有看到?

  • 打开 Glue > 作业 > 编辑您的作业 > 脚本库和作业参数(可选)> 底部附近的作业参数

  • 设置以下 > 键:--conf 值:spark.yarn.executor.memoryOverhead=1024

不幸的是,当前版本的 Glue 不支持此功能。 除了使用 UI,您无法设置其他参数。 在您的情况下,您可以使用 AWS EMR 服务,而不是使用 AWS Glue。

当我遇到类似问题时,我尝试减少shuffle的次数和shuffle的数据量,并增加DPU。 在解决这个问题的过程中,我基于以下文章。 我希望它们会有用。

http://blog.cloudera.com/blog/2015/03/how-to-tune-your-apache-spark-jobs-part-1/

https://www.indix.com/blog/engineering/lessons-from-using-spark-to-process-large-amounts-of-data-part-i/

https://umbertogriffo.gitbooks.io/apache-spark-best-practices-and-tuning/content/sparksqlshufflepartitions_draft.html


更新时间:2019-01-13

亚马逊最近在 AWS Glue 文档中添加了新部分,描述了如何监控和优化 Glue 作业。 我认为了解与内存问题相关的问题在哪里以及如何避免它是非常有用的。

https://docs.aws.amazon.com/glue/latest/dg/monitor-profile-glue-job-cloudwatch-metrics.html

如何设置多个--conf? 用空格隔开,逗号不起作用。 也不能使用--conf作为键添加其他键,值。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM