Spark:驱动程序内存参数的使用

Spark: use of driver-memory parameter

当我提交此命令时,我的作业失败并出现错误 "Container is running beyond physical memory limits"。

spark-submit --master yarn --deploy-mode cluster --executor-memory 5G --total-executor-cores 30 --num-executors 15 --conf spark.yarn.executor.memoryOverhead=1000

但是添加参数:--driver-memory 到 5GB(或更大),作业结束没有错误。

spark-submit --master yarn --deploy-mode cluster --executor-memory 5G --total executor-cores 30 --num-executors 15 --driver-memory 5G --conf spark.yarn.executor.memoryOverhead=1000

集群信息:6 个节点,120GB 内存。 YARN 容器内存最小值:1GB

问题是:这个参数用不用有什么区别?

如果增加驱动程序内存可以帮助您成功完成作业,那么这意味着驱动程序正在从执行程序中获取大量数据。通常,驱动程序负责在任务执行后从每个执行程序收集返回的结果。因此,在您的情况下,增加驱动程序内存似乎有助于将更多结果存储回驱动程序内存中。

如果您阅读了有关执行程序内存、驱动程序内存以及驱动程序与执行程序交互方式的一些要点,那么您将更加清楚自己所处的情况。

希望对你有所帮助。