Pyspark 原因:容器因超过内存限制而被纱线杀死。24.1 GB的24 GB物理内存

Pyspark 原因:容器因超过内存限制而被纱线杀死。24.1 GB的24 GB物理内存,pyspark,amazon-emr,Pyspark,Amazon Emr,我正在AWS EMR集群中运行pyspark作业,集群详细信息如下。 一个主实例m5.2xlarge 五个从属实例m5.2xlarge-8 vCore,32 GiB内存,仅EBS存储EBS存储:200 GiB 在我提交pyspark作业后,它失败了,出现以下错误 ExecutorLostFailure (executor 1 exited caused by one of the running tasks) Reason: Container killed by YARN for exceed

我正在AWS EMR集群中运行pyspark作业,集群详细信息如下。 一个主实例m5.2xlarge 五个从属实例m5.2xlarge-8 vCore,32 GiB内存,仅EBS存储EBS存储:200 GiB

在我提交pyspark作业后,它失败了,出现以下错误

ExecutorLostFailure (executor 1 exited caused by one of the running tasks) Reason: Container killed by YARN for exceeding memory limits. 24.1 GB of 24 GB physical memory used. Consider boosting spark.yarn.executor.memoryOverhead or disabling yarn.nodemanager.vmem-check-enabled because of YARN-4714.
下面是spark提交命令

spark-submit  --deploy-mode cluster --master yarn --num-executors 2 --executor-cores 5 --executor-memory 21g --driver-memory 10g --conf spark.yarn.executor.memoryOverhead=3g --conf spark.yarn.submit.waitAppCompletion=false --conf spark.yarn.maxAppAttempts=100 --conf spark.executor.extraJavaOptions=-Xss3m  --conf spark.driver.maxResultSize=3g --conf spark.dynamicAllocation.enabled=false

请为“执行器数量”、“执行器内存”和“无内核”提供更好的参数。

您的一个执行器JVM内存不足。正如错误所说的,考虑将Spk.Acn.Exctuut.Touple开销从3G提高到合理的值。

您还可以将-executor内存增加到应用程序所需的更大值

请参见此处的spark属性:
我无法增加-executor内存或spark.warn.executor.memoryOverhead,因为它将达到最大阈值24576 MB

将-num executors增加到5后,问题已得到解决