[Paper Review] Spark Parameter Tuning via Trial-and-Error
This paper proposes a lightweight, trial-and-error methodology for tuning 12 critical Spark parameters to significantly improve application performance with minimal experimental runs. By treating applications as black boxes and leveraging parameter correlations, the method achieves up to 10x speedups in three real-world case studies on a petascale supercomputer.
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.
Motivation & Objective
- Address the challenge of tuning Spark applications with over 150 configurable parameters, where exhaustive search is infeasible.
- Identify the most impactful parameters affecting Spark performance in real-world workloads.
- Develop a practical, application-specific tuning methodology requiring only 10 or fewer experimental runs.
- Demonstrate the effectiveness of the methodology through case studies showing substantial performance improvements.
- Provide a principled, low-overhead approach to parameter tuning that accounts for parameter correlations and hardware dependencies.
Proposed method
- Select 12 key Spark parameters based on their potential performance impact, including serialization, shuffle management, memory fractions, and compression settings.
- Apply a trial-and-error approach that prioritizes high-impact parameters first, such as spark.serializer and spark.shuffle.manager, based on empirical sensitivity analysis.
- Use a structured configuration sequence that tests parameter combinations in a way that accounts for inter-parameter correlations.
- Treat each Spark application as a black box, avoiding deep code-level analysis, and focus on measurable performance changes.
- Set performance improvement thresholds (e.g., 5–10%) to guide when to stop experimentation and accept a configuration.
- Leverage results from a single petascale supercomputer (MareNostrum) to derive a generalizable tuning strategy applicable to arbitrary applications.
Experimental results
Research questions
- RQ1Which of Spark’s 150+ configurable parameters have the most significant impact on application performance in real workloads?
- RQ2Can a low-overhead, trial-and-error methodology effectively identify high-performance configurations without exhaustive search?
- RQ3How do parameter interactions and correlations affect tuning outcomes across diverse Spark applications?
- RQ4To what extent can performance be improved using only a small number of experimental runs in a principled manner?
- RQ5Does the proposed methodology generalize across different applications and input data characteristics?
Key findings
- The KryoSerializer (spark.serializer) had the highest performance impact, reducing runtime by 44% in the sort-by-key benchmark compared to the default.
- Using the hash shuffle manager with file consolidation (shuffle.consolidateFiles=true) and optimal memory fractions (0.4/0.4) improved sort-by-key performance from 218 to 120 seconds.
- In the k-means case study, the final configuration (memoryFraction=0.1/0.7 and shuffle.spill.compress=false) reduced runtime from 654 to 54 seconds, achieving a 91% speedup.
- For aggregate-by-key, a 21% improvement was achieved with a 5% threshold, using hash shuffle and memoryFraction=0.1/0.7, demonstrating effectiveness on new workloads.
- Performance gains were highly input-dependent, as shown by the k-means case where results differed significantly from earlier profiling runs due to data characteristics.
- The methodology achieved up to 10x speedup in real applications with only 10 or fewer experimental runs, validating its efficiency and practicality.
Read this paper
Open the full text in the Nubint reader and ask about any passage as you read.
Read this paper on NubintThis review was generated by AI from the original paper. Please check the paper before citing it.