【发布时间】:2019-07-30 04:01:40
【问题描述】:
我正在尝试在 pyspark shell 中设置一些 spark 参数的配置。
我尝试了以下
spark.conf.set("spark.executor.memory", "16g")
为了检查执行器内存是否已设置,我做了以下
spark.conf.get("spark.executor.memory")
返回"16g"。
我试图通过sc 使用
sc._conf.get("spark.executor.memory")
然后返回"4g"。
为什么这两个返回不同的值以及设置这些配置的正确方法是什么。
另外,我正在摆弄一堆参数,比如
"spark.executor.instances"
"spark.executor.cores"
"spark.executor.memory"
"spark.executor.memoryOverhead"
"spark.driver.memory"
"spark.driver.cores"
"spark.driver.memoryOverhead"
"spark.memory.offHeap.size"
"spark.memory.fraction"
"spark.task.cpus"
"spark.memory.offHeap.enabled "
"spark.rpc.io.serverThreads"
"spark.shuffle.file.buffer"
有没有办法为所有变量设置配置。
编辑
我需要以编程方式设置配置。完成 spark-submit 或启动 pyspark shell 后如何更改它?我正在尝试减少我的作业的运行时间,我正在经历多次迭代,更改 spark 配置并记录运行时间。
【问题讨论】:
标签: python-3.x apache-spark pyspark apache-spark-sql