1 前言
基于spark2.3.0的簡(jiǎn)單性能測(cè)試分析已經(jīng)進(jìn)行兩輪,結(jié)果并不是十分滿(mǎn)意,總體而言就是Bug多多,性能有regression,兼容性不保障。所以,在對(duì)待各種x.x.0版本我們還是要盡量避免去應(yīng)用于生產(chǎn),防止跳進(jìn)坑里無(wú)法自拔,有新特性的話(huà)自己學(xué)習(xí)下,跟緊時(shí)代就好了。
按照spark社區(qū)的套路,跟著0跳進(jìn)坑,跟著1比較穩(wěn),跟著2你就慢了。比如你用2.3.0直接上社區(qū)的坑就夠你喝一壺了,比較妥的還是在2.3.1上,但如果在2.3.2在上,一般2.4就出來(lái)了,新的特性就會(huì)讓人患得患失了。
趁著2.3.1發(fā)布在即,做些簡(jiǎn)單測(cè)試,看看是否能發(fā)現(xiàn)的點(diǎn)問(wèn)題,讓這個(gè)版本在出來(lái)的時(shí)候也穩(wěn)定些。
本文基于rc2進(jìn)行測(cè)試。
2 測(cè)試數(shù)據(jù)
| benchmark | scale | fileformat | partitioned | link |
|---|---|---|---|---|
| TPCDS | 1T | parquet | true | https://github.com/yaooqinn/tpcds-for-spark |
3 實(shí)驗(yàn)對(duì)象
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 實(shí)驗(yàn)組
| baseline | modified | commit | link |
|---|---|---|---|
| 2.3.1-rc2 | false | 93258d8 | https://github.com/apache/spark/tree/v2.3.1-rc2 |
4 配置
4.1 硬件配置
| 機(jī)器類(lèi)別 | CPU | Memory | Disk | 臺(tái)數(shù) | Services |
|---|---|---|---|---|---|
| 虛擬機(jī) | 4 × 1 × 1 | 32g | 500g × 1 | 5 | NN(1) SNN (1) RM(1) HMS(1) SHS(1) |
| 物理機(jī) | 48 × 2 × 12 | 256g | 7.3T × 12 | 3 | DN(3) NM(3) |
| 物理機(jī) | 48 × 2× 12 | 256g | 1.1T × 1 | 4 | DN(4) NM(4) |
| 物理機(jī) | 32 × 2 × 8 | 128g | 3.6T × 12 | 1 | DN(1) NM(1) |
| 物理機(jī) | 40 × 2 × 10 | 256g | 1.5T × 1 | 1 | DN(1) NM(1) |
| 物理機(jī) | 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 測(cè)試結(jié)果
5.1 實(shí)驗(yàn)數(shù)據(jù)

實(shí)驗(yàn)數(shù)據(jù)

顯示規(guī)則
- 列1:sql statement
- 列2:參照組結(jié)果2.1.2
- 列3:參照組結(jié)果2.3.0
- 列4:實(shí)驗(yàn)組結(jié)果
- 顯示規(guī)則見(jiàn)上圖
5.2 定性結(jié)果
-
貌似 query 72 性能問(wèn)題依然存在,這個(gè)Sort對(duì)應(yīng)的Stage還是慢了一半
image.png
6 總結(jié)
- 本回合測(cè)試基于的是尚不穩(wěn)定的spark2.3.1-rc2, 就在剛剛之前這個(gè)rc已經(jīng)取消。
- SortExec的regression問(wèn)題依然存在
8 后記
問(wèn)題依舊在,幾度夕陽(yáng)紅。
