【发布时间】:2021-08-19 15:52:24
【问题描述】:
在我的服务器上以独立集群模式运行 spark 作业时遇到错误。
我遇到的错误类似于:
WARN TaskMemoryManager: Failed to allocate a page (x bytes), try again.
其中 x 可以是:
一些建议的解决方案:
我的 spark 工作的目标是:
- 加入一些表(3 到 4),
- 应用一些清洁功能,
- 将结果(1 df,最大大小 300 MB)保存到 HDFS 中
运行 Job 后的 htop:
我的服务器规格:
- 内存:31GB
- CPU:8
- 每个插槽的核心数:8
我的配置:(伪代码)
spark.sql.execution.arrow.enabled: True,
spark.driver.maxResultSize: 0,
spark.driver.memory: 15g,
spark.executor.memory: 15g,
spark.dynamicAllocation.enabled: True,
spark.shuffle.service.enabled: True,
spark.network.timeout: 10000001,
spark.executor.heartbeatInterval: 10000000,
spark.sql.crossJoin.enabled: True
附注:
-
这曾经在使用上述细节和更大的数据集之前工作 (大约 300GB)没有问题
-
我还是新手
我试过了:
- stop-all.sh(hadoop 和 spark)
- 更改配置
spark.executor.memory: 10g - 添加一些配置:
spark.sql.autoBroadcastJoinThreshold: -1和spark.sql.broadcastTimeout: 3000
【问题讨论】:
标签: apache-spark pyspark hdfs out-of-memory taskmanager