SlideShare a Scribd company logo
Apple logo is a trademark of Apple Inc.
Holden Karau | Data / AI Summi
t

@holdenkara
u

Improving Spark for Dynamic
Allocation & Spot Instances
Who am I?
• Holden Kara
u

• She / he
r

• Apache Spark PMC
• Contributor to a lot of other projects
• co-author of High Performance
Spark, Learning Spark, and Kubeflow
for Machine Learning
• http://bit.ly/holdenSparkVideos
• https://youtube.com/user/holdenkarau
Apple logo is a trademark of Apple Inc.
Let us start at the beginning
• Spark achieves resilience through re-computation which is part of how we go fas
• This poses challenges with removing executors that may contain dat
• We "solved" it for YARN/Mesos back in the da
• I drank waaaay too much coffee and came up with an alternativ
• But no one really liked it because we didn't need it so I closed the Google doc and
forgot about i
t

• Don’t worry, we’ll get to the code soon :)
But then….
• The "cloud" became really popula
r

• Kubernetes became popula
r

• Everything caught on fire :/
Our Protagonist Remembers
• I started drinking a lot of coffee
 

• We dusted off that old design and wrote
some cod
e

• And then I got hit by a ca
r

• More people wrote more cod
e

• We had a VOT
E

• We wrote waaaaay more cod
e

• Everyone lived happily ever after?
Photo by Lukas from Pexels
How did DA work on YARN?
• Scale up is "easy" (add more
resources
)

• Scale down required a stay resident
program to be on each YARN node to
serve any file
s

• Spark stored it's shuffle data as file
s

• Persist in memory data was still lost
when scaling down an executor
Photo by Markus Spiske from Pexels
Why did the cloud impact this?
• If you wanted a ~50% cost saving of
spot/preemptible instances you might
lose entire machine
s

• Yes Spark can "handle" this, but does
so by recomputing data (expensive
)

• You can't depend on leaving a program
around to serve files when the server is
just gon
e

• So we need to find a way to migrate the
data
Ok sure the cloud, but K8s?
• Kubernetes doesn't like like the idea of
scheduling a stay resident program on
every nod
e

• Also most people don't like the idea of
shared disk here either (accros jobs/
users
)

• So we need to find a way to migrate the
data
SPARK-20624
• Yee-haw
!

• Ok but more seriously how does it work? Great question lets open up the code
• BlockManagerDecomissioner.scala is where most of the magic happens
Collaboration
http://apache-spark-developers-list.1001551.n3.nabble.com/VOTE-
Decommissioning-SPIP-td29701.htm
l

https://github.com/apache/spark/pulls?q=is%3Apr+decommission+is%3Aclosed+
Ok what about the car?
Getting hit by a car sucks a lot
Slowed down dev work while I did rehab to be able
to walk & type again
Shout out to everyone who helped me recover
(from my wife, girlfriend, partners, my friends, to
the hospital staff, nursing home, PT, OT,
Ambulance, my employer for giving me time off,
the Spark community for understanding I needed
time off <3)
It’s early though so please be careful
On a Happy Note: You can try this now
• Enable the followin
g

- spark.decommission.enabled


- spark.storage.decommission.enabled


- spark.storage.decommission.rddBlocks.enabled
- spark.storage.decommission.shuffleBlocks.enabled
• Want to get fancy? Optionally enable:


- spark.shuffle.externalStorage.enabled


- And configure a storage backend ( spark.shuffle.externalStorage.backend)
Future work
• Heuristics to migrate dat
a

• Improve container pre-emption selectio
• Better heuristics around when to scale up and down containers
Please review this talk :)
TM and © 2021 Apple Inc. All rights reserved.

More Related Content

PPTX
Apache Flink Training: System Overview
PDF
FPGA-Based Acceleration Architecture for Spark SQL Qi Xie and Quanfu Wang
PDF
What is in a Lucene index?
PDF
The Flux Capacitor of Kafka Streams and ksqlDB (Matthias J. Sax, Confluent) K...
PDF
Asynchronous Replication for PostgreSQL Slony
PDF
Magnet Shuffle Service: Push-based Shuffle at LinkedIn
PDF
Apache flink
PDF
Best Practices for Enabling Speculative Execution on Large Scale Platforms
Apache Flink Training: System Overview
FPGA-Based Acceleration Architecture for Spark SQL Qi Xie and Quanfu Wang
What is in a Lucene index?
The Flux Capacitor of Kafka Streams and ksqlDB (Matthias J. Sax, Confluent) K...
Asynchronous Replication for PostgreSQL Slony
Magnet Shuffle Service: Push-based Shuffle at LinkedIn
Apache flink
Best Practices for Enabling Speculative Execution on Large Scale Platforms

What's hot (20)

PPTX
ORC File - Optimizing Your Big Data
PPTX
Apache Flink: Real-World Use Cases for Streaming Analytics
PDF
Massive Data Processing in Adobe Using Delta Lake
PPTX
The columnar roadmap: Apache Parquet and Apache Arrow
PPT
Cloudera Impala Internals
PPTX
Exactly-Once Financial Data Processing at Scale with Flink and Pinot
PDF
Deploying Flink on Kubernetes - David Anderson
PDF
Enabling Vectorized Engine in Apache Spark
PDF
My first 90 days with ClickHouse.pdf
PDF
Dongwon Kim – A Comparative Performance Evaluation of Flink
PDF
[OpenInfra Days Korea 2018] Day 2 - CEPH 운영자를 위한 Object Storage Performance T...
PDF
Escalabilidade e Disponibilidade em Arquiteturas Web
PPTX
Apache Tez – Present and Future
PDF
Apache Spark Performance Troubleshooting at Scale, Challenges, Tools, and Met...
PPTX
Apache Tez - A unifying Framework for Hadoop Data Processing
PPTX
Squirreling Away $640 Billion: How Stripe Leverages Flink for Change Data Cap...
PPTX
Using Queryable State for Fun and Profit
PPTX
Apache Tez: Accelerating Hadoop Query Processing
PPTX
Scylla Summit 2022: Making Schema Changes Safe with Raft
PPTX
[211] HBase 기반 검색 데이터 저장소 (공개용)
ORC File - Optimizing Your Big Data
Apache Flink: Real-World Use Cases for Streaming Analytics
Massive Data Processing in Adobe Using Delta Lake
The columnar roadmap: Apache Parquet and Apache Arrow
Cloudera Impala Internals
Exactly-Once Financial Data Processing at Scale with Flink and Pinot
Deploying Flink on Kubernetes - David Anderson
Enabling Vectorized Engine in Apache Spark
My first 90 days with ClickHouse.pdf
Dongwon Kim – A Comparative Performance Evaluation of Flink
[OpenInfra Days Korea 2018] Day 2 - CEPH 운영자를 위한 Object Storage Performance T...
Escalabilidade e Disponibilidade em Arquiteturas Web
Apache Tez – Present and Future
Apache Spark Performance Troubleshooting at Scale, Challenges, Tools, and Met...
Apache Tez - A unifying Framework for Hadoop Data Processing
Squirreling Away $640 Billion: How Stripe Leverages Flink for Change Data Cap...
Using Queryable State for Fun and Profit
Apache Tez: Accelerating Hadoop Query Processing
Scylla Summit 2022: Making Schema Changes Safe with Raft
[211] HBase 기반 검색 데이터 저장소 (공개용)
Ad

Similar to Improving Apache Spark for Dynamic Allocation and Spot Instances (20)

PDF
Leveraging Databricks for Spark Pipelines
PDF
Leveraging Databricks for Spark pipelines
PDF
Deploying Apache Spark Jobs on Kubernetes with Helm and Spark Operator
PDF
Stackato v4
PDF
Sharing (or stealing) the jewels of python with big data &amp; the jvm (1)
PDF
Kafka Summit SF 2017 - Streaming Processing in Python – 10 ways to avoid summ...
PDF
Stackato v6
PPTX
Data Science at Scale: Using Apache Spark for Data Science at Bitly
PDF
Machine learning in real-time - the next frontier
PDF
Apache Spark for Everyone - Women Who Code Workshop
PPTX
spark
PDF
Stackato
PDF
Best Practice in Accelerating Data Applications with Spark+Alluxio
PDF
Stackato v3
PDF
Apache Spark At Apple with Sam Maclennan and Vishwanath Lakkundi
PPTX
Dec6 meetup spark presentation
PPTX
Apache Spark - Lightning Fast Cluster Computing - Hyderabad Scalability Meetup
PPTX
LanceShivnathHadoopSummit2015
PDF
12-Step Program for Scaling Web Applications on PostgreSQL
PDF
Stackato v5
Leveraging Databricks for Spark Pipelines
Leveraging Databricks for Spark pipelines
Deploying Apache Spark Jobs on Kubernetes with Helm and Spark Operator
Stackato v4
Sharing (or stealing) the jewels of python with big data &amp; the jvm (1)
Kafka Summit SF 2017 - Streaming Processing in Python – 10 ways to avoid summ...
Stackato v6
Data Science at Scale: Using Apache Spark for Data Science at Bitly
Machine learning in real-time - the next frontier
Apache Spark for Everyone - Women Who Code Workshop
spark
Stackato
Best Practice in Accelerating Data Applications with Spark+Alluxio
Stackato v3
Apache Spark At Apple with Sam Maclennan and Vishwanath Lakkundi
Dec6 meetup spark presentation
Apache Spark - Lightning Fast Cluster Computing - Hyderabad Scalability Meetup
LanceShivnathHadoopSummit2015
12-Step Program for Scaling Web Applications on PostgreSQL
Stackato v5
Ad

More from Databricks (20)

PPTX
DW Migration Webinar-March 2022.pptx
PPTX
Data Lakehouse Symposium | Day 1 | Part 1
PPT
Data Lakehouse Symposium | Day 1 | Part 2
PPTX
Data Lakehouse Symposium | Day 2
PPTX
Data Lakehouse Symposium | Day 4
PDF
5 Critical Steps to Clean Your Data Swamp When Migrating Off of Hadoop
PDF
Democratizing Data Quality Through a Centralized Platform
PDF
Learn to Use Databricks for Data Science
PDF
Why APM Is Not the Same As ML Monitoring
PDF
The Function, the Context, and the Data—Enabling ML Ops at Stitch Fix
PDF
Stage Level Scheduling Improving Big Data and AI Integration
PDF
Simplify Data Conversion from Spark to TensorFlow and PyTorch
PDF
Scaling your Data Pipelines with Apache Spark on Kubernetes
PDF
Scaling and Unifying SciKit Learn and Apache Spark Pipelines
PDF
Sawtooth Windows for Feature Aggregations
PDF
Redis + Apache Spark = Swiss Army Knife Meets Kitchen Sink
PDF
Re-imagine Data Monitoring with whylogs and Spark
PDF
Raven: End-to-end Optimization of ML Prediction Queries
PDF
Processing Large Datasets for ADAS Applications using Apache Spark
PDF
Machine Learning CI/CD for Email Attack Detection
DW Migration Webinar-March 2022.pptx
Data Lakehouse Symposium | Day 1 | Part 1
Data Lakehouse Symposium | Day 1 | Part 2
Data Lakehouse Symposium | Day 2
Data Lakehouse Symposium | Day 4
5 Critical Steps to Clean Your Data Swamp When Migrating Off of Hadoop
Democratizing Data Quality Through a Centralized Platform
Learn to Use Databricks for Data Science
Why APM Is Not the Same As ML Monitoring
The Function, the Context, and the Data—Enabling ML Ops at Stitch Fix
Stage Level Scheduling Improving Big Data and AI Integration
Simplify Data Conversion from Spark to TensorFlow and PyTorch
Scaling your Data Pipelines with Apache Spark on Kubernetes
Scaling and Unifying SciKit Learn and Apache Spark Pipelines
Sawtooth Windows for Feature Aggregations
Redis + Apache Spark = Swiss Army Knife Meets Kitchen Sink
Re-imagine Data Monitoring with whylogs and Spark
Raven: End-to-end Optimization of ML Prediction Queries
Processing Large Datasets for ADAS Applications using Apache Spark
Machine Learning CI/CD for Email Attack Detection

Recently uploaded (20)

PPTX
Business Acumen Training GuidePresentation.pptx
PPTX
MODULE 8 - DISASTER risk PREPAREDNESS.pptx
PPTX
1_Introduction to advance data techniques.pptx
PDF
Foundation of Data Science unit number two notes
PPT
Miokarditis (Inflamasi pada Otot Jantung)
PPTX
Database Infoormation System (DBIS).pptx
PPTX
STUDY DESIGN details- Lt Col Maksud (21).pptx
PDF
Mega Projects Data Mega Projects Data
PPTX
ALIMENTARY AND BILIARY CONDITIONS 3-1.pptx
PDF
.pdf is not working space design for the following data for the following dat...
PDF
“Getting Started with Data Analytics Using R – Concepts, Tools & Case Studies”
PPTX
IB Computer Science - Internal Assessment.pptx
PPTX
iec ppt-1 pptx icmr ppt on rehabilitation.pptx
PPTX
Introduction to Firewall Analytics - Interfirewall and Transfirewall.pptx
PPT
Chapter 2 METAL FORMINGhhhhhhhjjjjmmmmmmmmm
PPTX
Acceptance and paychological effects of mandatory extra coach I classes.pptx
PPTX
climate analysis of Dhaka ,Banglades.pptx
PPT
Chapter 3 METAL JOINING.pptnnnnnnnnnnnnn
PDF
Clinical guidelines as a resource for EBP(1).pdf
PPTX
The THESIS FINAL-DEFENSE-PRESENTATION.pptx
Business Acumen Training GuidePresentation.pptx
MODULE 8 - DISASTER risk PREPAREDNESS.pptx
1_Introduction to advance data techniques.pptx
Foundation of Data Science unit number two notes
Miokarditis (Inflamasi pada Otot Jantung)
Database Infoormation System (DBIS).pptx
STUDY DESIGN details- Lt Col Maksud (21).pptx
Mega Projects Data Mega Projects Data
ALIMENTARY AND BILIARY CONDITIONS 3-1.pptx
.pdf is not working space design for the following data for the following dat...
“Getting Started with Data Analytics Using R – Concepts, Tools & Case Studies”
IB Computer Science - Internal Assessment.pptx
iec ppt-1 pptx icmr ppt on rehabilitation.pptx
Introduction to Firewall Analytics - Interfirewall and Transfirewall.pptx
Chapter 2 METAL FORMINGhhhhhhhjjjjmmmmmmmmm
Acceptance and paychological effects of mandatory extra coach I classes.pptx
climate analysis of Dhaka ,Banglades.pptx
Chapter 3 METAL JOINING.pptnnnnnnnnnnnnn
Clinical guidelines as a resource for EBP(1).pdf
The THESIS FINAL-DEFENSE-PRESENTATION.pptx

Improving Apache Spark for Dynamic Allocation and Spot Instances

  • 1. Apple logo is a trademark of Apple Inc. Holden Karau | Data / AI Summi t @holdenkara u Improving Spark for Dynamic Allocation & Spot Instances
  • 2. Who am I? • Holden Kara u • She / he r • Apache Spark PMC • Contributor to a lot of other projects • co-author of High Performance Spark, Learning Spark, and Kubeflow for Machine Learning • http://bit.ly/holdenSparkVideos • https://youtube.com/user/holdenkarau
  • 3. Apple logo is a trademark of Apple Inc.
  • 4. Let us start at the beginning • Spark achieves resilience through re-computation which is part of how we go fas • This poses challenges with removing executors that may contain dat • We "solved" it for YARN/Mesos back in the da • I drank waaaay too much coffee and came up with an alternativ • But no one really liked it because we didn't need it so I closed the Google doc and forgot about i t • Don’t worry, we’ll get to the code soon :)
  • 5. But then…. • The "cloud" became really popula r • Kubernetes became popula r • Everything caught on fire :/
  • 6. Our Protagonist Remembers • I started drinking a lot of coffee • We dusted off that old design and wrote some cod e • And then I got hit by a ca r • More people wrote more cod e • We had a VOT E • We wrote waaaaay more cod e • Everyone lived happily ever after? Photo by Lukas from Pexels
  • 7. How did DA work on YARN? • Scale up is "easy" (add more resources ) • Scale down required a stay resident program to be on each YARN node to serve any file s • Spark stored it's shuffle data as file s • Persist in memory data was still lost when scaling down an executor Photo by Markus Spiske from Pexels
  • 8. Why did the cloud impact this? • If you wanted a ~50% cost saving of spot/preemptible instances you might lose entire machine s • Yes Spark can "handle" this, but does so by recomputing data (expensive ) • You can't depend on leaving a program around to serve files when the server is just gon e • So we need to find a way to migrate the data
  • 9. Ok sure the cloud, but K8s? • Kubernetes doesn't like like the idea of scheduling a stay resident program on every nod e • Also most people don't like the idea of shared disk here either (accros jobs/ users ) • So we need to find a way to migrate the data
  • 10. SPARK-20624 • Yee-haw ! • Ok but more seriously how does it work? Great question lets open up the code • BlockManagerDecomissioner.scala is where most of the magic happens
  • 12. Ok what about the car? Getting hit by a car sucks a lot Slowed down dev work while I did rehab to be able to walk & type again Shout out to everyone who helped me recover (from my wife, girlfriend, partners, my friends, to the hospital staff, nursing home, PT, OT, Ambulance, my employer for giving me time off, the Spark community for understanding I needed time off <3)
  • 13. It’s early though so please be careful On a Happy Note: You can try this now • Enable the followin g - spark.decommission.enabled - spark.storage.decommission.enabled - spark.storage.decommission.rddBlocks.enabled - spark.storage.decommission.shuffleBlocks.enabled • Want to get fancy? Optionally enable: - spark.shuffle.externalStorage.enabled - And configure a storage backend ( spark.shuffle.externalStorage.backend)
  • 14. Future work • Heuristics to migrate dat a • Improve container pre-emption selectio • Better heuristics around when to scale up and down containers
  • 16. TM and © 2021 Apple Inc. All rights reserved.