gpt4 book ai didi

hadoop - RM UI 中的 YARN "Memory Used"是 spark-shell 请求的两倍

转载 作者:可可西里 更新时间:2023-11-01 15:55:56 24 4
gpt4 key购买 nike

spark-shell 开始使用:

spark-shell --master yarn --executor-memory 4G --num-executors 100

我期望 yarn 为 spark-shell 分配大约 400GB 的内存,但是当我转到 RM UI 时,它显示“已使用的内存”增加了大约 804GB。

我正在运行 HDP 2.5,在 yarn-site.xml 中将 yarn.scheduler.minimum-allocation-mb 设置为 4096。

对这是怎么发生的感到困惑。


原来是spark内存开销和yarn内存分配机制的问题,查看:

http://www.wdong.org/spark-on-yarn-where-have-all-the-memory-gone.html

Rule 1. Yarn always rounds up memory requirement to multiples of yarn.scheduler.minimum-allocation-mb, which by default is 1024 or 1GB. That’s why the driver’s requirement of 4G+384M showed up as 5G in Yarn. The parameter yarn.scheduler.minimum-allocation-mb is really “minimum-allocation-unit-mb”. This can be easily verified by setting the parameter to a prime number, such as 97, and see Yarn allocate by multiples of the number.

Rule 2. Spark adds an overhead to SPARK_EXECUTOR_MEMORY/SPARK_DRIVER_MEMORY before asking Yarn for the amount.

也就是说,在我的配置中,即使是 spark-shell 也只要求 384MB 开销内存,这是 spark.yarn.executor.memoryOverhead 的默认值,yarn 会为其分配另外 4GB。

最佳答案

我的理解是 --executor-memory 为您提供了执行程序可以使用的内存上限,并成为执行程序的 -Xmx(JVM 的) .

在特定的时间点,它可能会使用更少(这很好)。

我会转到 YARN 节点并执行 jps -lm 并查看执行程序 JVM 使用的属性。

关于hadoop - RM UI 中的 YARN "Memory Used"是 spark-shell 请求的两倍,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/44093464/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com