[论文解读] Spark Parameter Tuning via Trial-and-Error
本文提出了一种轻量级的试错法,用于调优12个关键的Spark参数,仅通过少量实验即可显著提升应用性能。通过将应用视为黑箱并利用参数相关性,该方法在一台百亿亿级超级计算机上的三个真实案例研究中实现了最高10倍的性能提升。
Spark has been established as an attractive platform for big data analysis, since it manages to hide most of the complexities related to parallelism, fault tolerance and cluster setting from developers. However, this comes at the expense of having over 150 configurable parameters, the impact of which cannot be exhaustively examined due to the exponential amount of their combinations. The default values allow developers to quickly deploy their applications but leave the question as to whether performance can be improved open. In this work, we investigate the impact of the most important of the tunable Spark parameters on the application performance and guide developers on how to proceed to changes to the default values. We conduct a series of experiments with known benchmarks on the MareNostrum petascale supercomputer to test the performance sensitivity. More importantly, we offer a trial-and-error methodology for tuning parameters in arbitrary applications based on evidence from a very small number of experimental runs. We test our methodology in three case studies, where we manage to achieve speedups of more than 10 times.
研究动机与目标
- 解决Spark应用存在超过150个可配置参数所带来的调优挑战,其中穷举搜索不可行。
- 识别在真实工作负载中对Spark性能影响最大的参数。
- 开发一种仅需10次或更少实验运行的实用、应用特定的调优方法。
- 通过案例研究证明该方法的有效性,展示显著的性能提升。
- 提供一种有原则的、低开销的参数调优方法,能够考虑参数相关性和硬件依赖性。
提出的方法
- 基于其潜在性能影响,选择12个关键Spark参数,包括序列化、shuffle管理、内存比例和压缩设置。
- 采用试错法,优先调优高影响力参数(如spark.serializer和spark.shuffle.manager),基于经验敏感性分析。
- 使用结构化的配置序列,以考虑参数间相互关系的方式测试参数组合。
- 将每个Spark应用视为黑箱,避免深入的代码级分析,专注于可测量的性能变化。
- 设定性能提升阈值(例如5–10%),以指导何时停止实验并接受当前配置。
- 利用单台百亿亿级超级计算机(MareNostrum)的结果,推导出可推广的调优策略,适用于任意应用。
实验结果
研究问题
- RQ1在Spark的150多个可配置参数中,哪些对真实工作负载下的应用性能影响最大?
- RQ2一种低开销的试错法是否能有效识别高性能配置,而无需进行穷举搜索?
- RQ3参数交互和相关性如何影响不同类型Spark应用的调优结果?
- RQ4在有原则地仅使用少量实验运行的情况下,性能最多可提升多少?
- RQ5所提出的方法是否能泛化到不同应用和输入数据特征?
主要发现
- KryoSerializer(spark.serializer)的性能影响最大,在按键排序基准测试中,相比默认设置将运行时间减少了44%。
- 使用哈希shuffle管理器并启用文件合并(shuffle.consolidateFiles=true)及最优内存比例(0.4/0.4)后,按键排序性能从218秒提升至120秒。
- 在k-means案例研究中,最终配置(memoryFraction=0.1/0.7且shuffle.spill.compress=false)将运行时间从654秒减少至54秒,实现了91%的加速。
- 在聚合按键任务中,通过使用哈希shuffle和memoryFraction=0.1/0.7,实现了21%的性能提升,且在5%的阈值下即停止实验,证明了该方法在新工作负载上的有效性。
- 性能提升高度依赖于输入数据,如k-means案例所示,由于数据特征不同,结果与早期性能分析结果存在显著差异。
- 该方法在仅进行10次或更少实验运行的情况下,实现了真实应用中最高10倍的性能提升,验证了其高效性和实用性。
更好的研究,从现在开始
从阅读论文到最终审阅,大幅缩短您的研究时间。
无需绑定信用卡
本解读由 AI 生成,并经人工编辑审核。