1 前言
基于spark2.3.0的简单性能测试分析已经进行两轮,结果并不是十分满意,总体而言就是Bug多多,性能有regression,兼容性不保障。所以,在对待各种x.x.0版本我们还是要尽量避免去应用于生产,防止跳进坑里无法自拔,有新特性的话自己学习下,跟紧时代就好了。
按照spark社区的套路,跟着0跳进坑,跟着1比较稳,跟着2你就慢了。比如你用2.3.0直接上社区的坑就够你喝一壶了,比较妥的还是在2.3.1上,但如果在2.3.2在上,一般2.4就出来了,新的特性就会让人患得患失了。
趁着2.3.1发布在即,做些简单测试,看看是否能发现的点问题,让这个版本在出来的时候也稳定些。
本文基于rc2进行测试。
2 测试数据
benchmark | scale | fileformat | partitioned | link |
---|---|---|---|---|
TPCDS | 1T | parquet | true | https://github.com/yaooqinn/tpcds-for-spark |
3 实验对象
3.1 参照组
baseline | modified | commit | link |
---|---|---|---|
2.1.2 | true | 9ef23ae | https://github.com/yaooqinn/spark/tree/v2.1.2-based |
2.3.0 | false | - | https://www.apache.org/dyn/closer.lua/spark/spark-2.3.0/spark-2.3.0-bin-hadoop2.7.tgz |
3.2 实验组
baseline | modified | commit | link |
---|---|---|---|
2.3.1-rc2 | false | 93258d8 | https://github.com/apache/spark/tree/v2.3.1-rc2 |
4 配置
4.1 硬件配置
机器类别 | CPU | Memory | Disk | 台数 | Services |
---|---|---|---|---|---|
虚拟机 | 4 × 1 × 1 | 32g | 500g × 1 | 5 | NN(1) SNN (1) RM(1) HMS(1) SHS(1) |
物理机 | 48 × 2 × 12 | 256g | 7.3T × 12 | 3 | DN(3) NM(3) |
物理机 | 48 × 2× 12 | 256g | 1.1T × 1 | 4 | DN(4) NM(4) |
物理机 | 32 × 2 × 8 | 128g | 3.6T × 12 | 1 | DN(1) NM(1) |
物理机 | 40 × 2 × 10 | 256g | 1.5T × 1 | 1 | DN(1) NM(1) |
物理机 | 48 × 2 × 12 | 32g | 1.1T × 1 | 1 | DN(1) |
4.2 metrics
4.3 SparkConf
## Basic Settings ##
spark.master yarn
spark.submit.deployMode client
spark.serializer org.apache.spark.serializer.KryoSerializer
spark.kryoserializer.buffer.max 256m
spark.local.dir ./local
## Hadoop Settings ##
spark.hadoop.fs.hdfs.impl.disable.cache true
spark.hadoop.fs.file.impl.disable.cache true
## Driver/AM Settings ##
spark.yarn.am.cores 2
spark.yarn.am.memory 2g
spark.yarn.am.memoryOverhead 512
spark.yarn.am.extraJavaOptions -XX:PermSize=1024m -XX:MaxPermSize=2048m -verbose:gc -XX:+PrintGCDetails -XX:+PrintGCDateStamps -XX:+PrintTenuringDistribution
spark.driver.maxResultSize 2g
spark.driver.memory 30g
spark.driver.extraJavaOptions -XX:PermSize=1024m -XX:MaxPermSize=1024m
## Executor Settings ##
spark.executor.instances 40
spark.executor.cores 4
spark.executor.memory 20g
spark.executor.memoryOverhead 4096
spark.executor.extraJavaOptions -XX:PermSize=1024m -XX:MaxPermSize=1024m -verbose:gc -XX:+PrintGCDetails -XX:+PrintGCDateStamps -XX:+PrintTenuringDistribution
## Security Settings ##
spark.yarn.keytab ?
spark.yarn.principal ?
## Dynamic Allocation Settings ##
spark.shuffle.service.enabled true
spark.dynamicAllocation.enabled false
spark.dynamicAllocation.initialExecutors 1
spark.dynamicAllocation.minExecutors 1
spark.dynamicAllocation.maxExecutors 50
## SQL Configurations ##
spark.sql.autoBroadcastJoinThreshold 204857600
spark.sql.warehouse.dir /user/spark/warehouse
# spark.sql.hive.convertCTAS true
# spark.sql.sources.default parquet
spark.sql.shuffle.partitions 1024
# spark.sql.hive.convertMetastoreParquet false
spark.sql.crossJoin.enabled=true
spark.sql.statistics.fallBackToHdfs=true
## History Server Client Settings ##
# spark.eventLog.enabled true
spark.eventLog.compress true
spark.eventLog.dir hdfs:///spark2-history/
spark.yarn.historyServer.address ?:18081
5 测试结果
5.1 实验数据


- 列1:sql statement
- 列2:参照组结果2.1.2
- 列3:参照组结果2.3.0
- 列4:实验组结果
- 显示规则见上图
5.2 定性结果
-
貌似 query 72 性能问题依然存在,这个Sort对应的Stage还是慢了一半
image.png
6 总结
- 本回合测试基于的是尚不稳定的spark2.3.1-rc2, 就在刚刚之前这个rc已经取消。
- SortExec的regression问题依然存在
8 后记
问题依旧在,几度夕阳红。
网友评论