Spark性能调优之Shuffle调优
Spark性能调优之Shuffle调优 • Spark底层shuffle的传输方式是使用netty传输,netty在进行网络传输的过程会申请堆外 内存(netty是零拷贝),所以使用了 堆外内存 。 • shuffle过程中常出现的问题 常见问题一:reduce oom? 问题原因: reduce task 去map端获取数据,reduce一边拉取数据一边聚合,reduce端有一块聚合内存(executor memory * 0.2),也就是这块内存不够 解决办法: 1.增加reduce 聚合操作的内存的比例 2.增加Executor memory的大小 --executor-memory 5G 3.减少reduce task每次拉取的数据量 设置 spak.reducer.maxSizeInFlight 24m, 拉取的次数就多了,因此建立连接的次数增多,有可能会连接不上(正好赶上map task端进行GC) 常见问题二:错误描述--shuffle file cannot find or executor lost • 什 么时候需要调节Executor的堆外内存大小? • shuffle file cannot find (DAGScheduler,resubmitting task) • executor lost • task lost • out of memory