1.1 常规性能调优
1.1.1 最优资源配置
性能调优的第一步应该是为任务分配更多的资源,在一定范围内,增加资源与提升性能成正比。
spark提交任务的脚本示例
./spark-submit \
--master yarn-cluster
--class com.dtyunxi.spark.WordCount \
--num-executors 80
--executor-cores 4
--executor-memory 8g
--driver-memory 8g
--queue root.default
--conf spark.yarn.executor.memoryOverhead=2048
--conf spark.core.connection.ack.wait.timeout=300
/usr/opt/modules/spark/jar/spark.jar
名称 | 说明 |
---|---|
–num-executors | 配置Executor的数量 |
executor-cores | 为每个executor分配的cpu核数 |
executor-memory | 为每个executor分配的内存数 |
driver-memory | 配置driver的内存(影响不大) |
spark.yarn.executor.memoryOverhead | executor堆外内存 |
spa |