本文主要收录spark学习和工作中思考的问题。
####1、当Spark task failed,什么情况下task重计算,什么情况下stage重计算?
答:如果task失败是因为shuffle output files lost,则DAGScheduler会对stage重提交计算;如果不是因为shuffle file lost,则选择resubmit task。这是因为shuffle output file lost涉及stage之间的失误,需要上游重提交stage产生新的shuffle output文件。
####2、参数spark.yarn.executor.memoryOverhead与参数spark.memory.offHeap.size都表示堆外内存大小,有什么区别?
答:作用不同。因为spark.yarn.executor.memoryOverhead表示Executor自身JVM进程需要的内存开销,spark.memory.offHeap.size表示rdd计算执行和数据存储使用的offheap(默认计算和存储各占50%,由参数spark.memory.storageFraction控制)。
####3、关于shuffle write、shuffle spill (memory)、shuffle spill (disk)概念有什么区别?
- shuffle spill memory: 表示spill过程中没有序列化的在内存的数据。
- shuffle spill disk:表示spill结束后spill到disk的序列化后的数据。
- shuffle write: 表示数据在executor之间移动,例如join、groupBy等操作。
shuffle spill跟shuffle write总