AWS Big Data Blog
Amazon EMR launches support for Amazon EC2 M6A, R6A instances to improve cost performance for Spark workloads by 15–50%
Amazon EMR provides a managed service to easily run analytics applications using open-source frameworks such as Apache Spark, Hive, Presto, Trino, HBase, and Flink. The Amazon EMR runtime for Spark and Presto includes optimizations that provide over 2x performance improvements over open-source Apache Spark and Presto.
With Amazon EMR release 6.8, you can now use Amazon Elastic Compute Cloud (Amazon EC2) instances such as M6A and C6A, which use the third generation AMD EPYC processors. These instances improve the price performance of running Spark workloads on Amazon EMR by 15–50 percent over previous generation instances. In this blog post, we describe how we estimated this price performance benefit.
Amazon EMR runtime performance with EC2 M6A instances
We ran TPC-DS 3 TB benchmark queries on Amazon EMR 6.8 using Amazon EMR runtime for Apache Spark (compatible with Apache Spark 3.3) with M6a instances. Data was stored in Amazon Simple Storage Service (Amazon S3), and results were compared to equivalent clusters with M5a, which is the previous generation instance family. We measured performance improvements using the total query runtime and the geometric mean of query runtime across TPC-DS 3 TB benchmark queries.
Our results showed a 23.6–50.3 percent improvement in total query runtime performance and 22.8–52.4 percent in geometric mean on an EMR cluster with M6a compared to an equivalent EMR cluster with M5a instances. In comparing costs, we observed a 23.2–41.4 percent reduction in cost on the EMR cluster with M6a compared to the equivalent with M5a. M6A 48 XL and 32 XL instances were not benchmarked because the M5A generation does not offer equivalent sizes.
The following table shows the results from running TPC-DS 3 TB benchmark queries using Amazon EMR 6.8 over equivalent M6a and M5a instance EMR clusters.
Instance Size | 24 XL | 16 XL | 12 XL | 8 XL | 4 XL | 2 XL | XL |
Total size of the cluster (1 Leader + 5 core nodes) | 6 | 6 | 6 | 6 | 6 | 6 | 6 |
Total query runtime on M5A (seconds) | 6624.1713838714 | 5466.7251180433 | 5269.0578151495 | 5366.1486275129 | 7753.6218015794 | 12118.0922180235 | 21070.6905510002 |
Total query runtime on M6A (seconds) | 3295.2894058371 | 3063.7807673078 | 3399.1509249577 | 3482.8401591909 | 4906.2216891762 | 9184.4366036450 | 16107.9707619002 |
Total query runtime improvement with M6A | 50.25% | 43.96% | 35.49% | 35.10% | 36.72% | 24.21% | 23.55% |
Geometric mean query runtime M5A (sec) | 51.1422829354 | 40.9550798753 | 38.4890223194 | 35.3863834186 | 44.8454957416 | 61.0454658020 | 92.6414502105 |
Geometric mean query runtime M6A (sec) | 24.3406154481 | 22.3484713891 | 22.9913163520 | 23.0351017440 | 28.2855683398 | 46.4363267349 | 71.5498816854 |
Geometric mean query runtime improvement with M6A | 52.41% | 45.43% | 40.27% | 34.90% | 36.93% | 23.93% | 22.77% |
EC2 M5A instance price ($ per hour) | $4.12800 | $2.75200 | $2.06400 | $1.37600 | $0.68800 | $0.34400 | $0.17200 |
EMR M5A instance price ($ per hour) | $0.27000 | $0.27000 | $0.27000 | $0.27000 | $0.17200 | $0.08600 | $0.04300 |
(EC2 + EMR) M5A instance price ($ per hour) | $4.39800 | $3.02200 | $2.33400 | $1.64600 | $0.86000 | $0.43000 | $0.21500 |
Cost of running on M5A ($ per instance) | $8.09253 | $4.58901 | $3.41611 | $2.45352 | $1.85225 | $1.44744 | $1.25839 |
EC2 M6A instance price ($ per hour) | $4.14720 | $2.76480 | $2.07360 | $1.38240 | $0.69120 | $0.34560 | $0.17280 |
EMR M6A price ($ per hour per instance) | $1.03680 | $0.69120 | $0.51840 | $0.34560 | $0.17280 | $0.08640 | $0.04320 |
(EC2 + EMR) M6A instance price ($ per hour) | $5.18400 | $3.45600 | $2.59200 | $1.72800 | $0.86400 | $0.43200 | $0.21600 |
Cost of running on M6A ($ per instance) | $4.74522 | $2.94123 | $2.44739 | $1.67176 | $1.17749 | $1.10213 | $0.96648 |
Total cost reduction with M6A including performance improvement | -41.36% | -35.91% | -28.36% | -31.86% | -36.43% | -23.86% | -23.20% |
The following graph shows per query improvements observed on M6a 2XL instances compared to equivalent M5a generation. We observed that two queries take longer to execute on M6a instance clusters compared to M5a instance clusters. Q91 regressed up to 6.64 percent and Q55 regressed up to 1.86 percent on 4 XL instance clusters.
Amazon EMR runtime performance with EC2 R6A instances
R6A instances showed a similar performance improvement while running Apache Spark workloads compared to equivalent R5A instances. R6A 32XL and 48XL instances were not benchmarked since R5A instances do not have 32XL and 48XL sizes available. Our results showed 16–58.22 percent improvement in total query runtime for seven different instance sizes within the instance family and 20.04–59.59 percent improvement in geometric mean. In comparing costs, we observed 15.85–-50.07 percent reduction in cost on R6A instance EMR clusters compared to R5A EMR instance clusters.
The following table shows the results from running TPC-DS 3 TB benchmark queries using Amazon EMR 6.8 over equivalent R6A and R5A instance EMR clusters.
Instance Size | 24 XL | 16 XL | 12 XL | 8 XL | 4 XL | 2 XL | XL |
Total size of the cluster (1 Leader + 5 core nodes) | 6 | 6 | 6 | 6 | 6 | 6 | 6 |
Total query runtime on R5A (seconds) | 6934.22936 | 5530.74672 | 5834.32344 | 5718.72582 | 7615.58392 | 11431.37368 | 20688.58642 |
Total query runtime on R6A (seconds) | 2897.44817 | 2906.49952 | 3017.85315 | 3488.83875 | 4661.32856 | 7717.33575 | 17378.49043 |
Total query runtime improvement with R6A | 58.22% | 47.45% | 48.27% | 38.99% | 38.79% | 32.49% | 16.00% |
Geometric mean query runtime R5A (sec) | 53.27574 | 41.76973 | 42.50324 | 37.62155 | 44.58173 | 58.88182 | 91.72095 |
Geometric mean query runtime R6A (sec) | 21.52803 | 21.36831 | 19.94607 | 21.59493 | 26.90097 | 36.57557 | 73.3405 |
Geometric mean query runtime improvement with R6A | 59.59% | 48.84% | 53.07% | 42.60% | 39.66% | 37.88% | 20.04% |
EC2 R5A instance price ($ per hour) | $5.42400 | $3.61600 | $2.71200 | $1.80800 | $0.90400 | $0.45200 | $0.22600 |
EMR R5A instance price ($ per hour) | $0.27000 | $0.27000 | $0.27000 | $0.27000 | $0.22600 | $0.11300 | $0.05700 |
(EC2 + EMR) R5A instance price ($ per hour) | $5.69400 | $3.88600 | $2.98200 | $2.07800 | $1.13000 | $0.56500 | $0.28300 |
Cost of running on R5A ($ per instance) | $10.96764 | $5.97013 | $4.83276 | $3.30098 | $2.39045 | $1.79409 | $1.62635 |
EC2 R6A instance price ($ per hour) | $5.44320 | $3.62880 | $2.72160 | $1.81440 | $0.90720 | $0.45360 | $0.22680 |
EMR R6A price ($ per hour per instance) | $1.36080 | $0.90720 | $0.68040 | $0.45360 | $0.22680 | $0.11340 | $0.05670 |
(EC2 + EMR) R6A instance price ($ per hour) | $6.80400 | $4.53600 | $3.40200 | $2.26800 | $1.13400 | $0.56700 | $0.28350 |
Cost of running on R6A ($ per instance) | $5.47618 | $3.66219 | $2.85187 | $2.19797 | $1.46832 | $1.21548 | $1.36856 |
Total cost reduction with R6A including performance improvement | -50.07% | -38.66% | -40.99% | -33.41% | -38.58% | -32.25% | -15.85% |
Benchmarking methodology
The benchmark used in this post is derived from the industry-standard TPC-DS benchmark and uses queries from the Spark SQL Performance Tests GitHub repo with the following fixes applied.
We calculated TCO by multiplying cost per hour by number of instances in the cluster and time taken to run the queries on the cluster. We used the on-demand pricing in the US East (N. Virginia) Region for all instances.
Conclusion
In this post, we described how we estimated the cost-performance benefit from using Amazon EMR with M6A and R6A instances compared to using equivalent previous-generation instances. Using these new instances with Amazon EMR improves price performance by 15–50%.
About the authors
Al MS is a product manager for Amazon EMR at Amazon Web Services.
Kyeonghyun Ryoo is a Software Development Engineer for EMR at Amazon Web Services. He primarily works on designing and building automation tools for internal teams and customers to maximize their productivity. Outside of work, he is a retired world champion in professional gaming who still enjoy playing video games.