SlideShare a Scribd company logo
Managing Thousands of Spark
Workers in Cloud Environment
#HWCSAIS14
Yuhao Zheng & Boduo Li, DataVisor
1
4
0
1
2
3
4
5 THOUSANDS
How To
2#HWCSAIS14
15
3
0
5
10
15
20 MILLIONS
40
10
0
10
20
30
40
50
Peak Scale
# of Spark executors
Cloud Cost
Annual cost in USD
Ops Cost
Weekly man-hour
4X
5X 4X
3#HWCSAIS14
• Focus on fraud detection
• Founded in Dec 2013
• 100-person team
Coordinated Online Attacks
4#HWCSAIS14
Crime Ring Malicious Accounts Loss: >50B/Year
Transaction
Fraud
Fake
Review
Promotion
Abuse
Launch Attacks
DataVisor: UML Fraud Detection
5#HWCSAIS14
Early Detection
Catch incubated accounts
High Coverage and Accuracy
Detect all bad users in a campaign
Unknown Attack Detection
Catch unknown suspicious activities
Unsupervised Machine Learning
UML is Expensive
6#HWCSAIS14
Register
Profile
Login
Trasaction
…
Data Clean,
Feature Ext.
User Events
Feature Pool: Thousands of Features
Behavior
Pattern
Profile
Pattern
Device
Pattern
application_freq
application_time
…
…
work_year_distrib
marriage_distrib
promoter_info
…
deviceid_distrib
ip_usage
devicetype_var
…
…
…
…
!(#, %) = (
)
*) ∗ ,)(-. , -/)
Clustering
Analysis
01 = (
1
!1(#, %)
Association probability
Clustering probability
…
Huge Data Volume
7#HWCSAIS14
3 Billion+ user accounts
600 Billion+ events and growing
3 Petabytes of data
Schedule Dependency
8#HWCSAIS14
Pipeline Module
Original Data
Pipeline Module
Pipeline Module
Pipeline Module
Pipeline Module Pipeline Module
~20 modules / client
Original Data
Detection
Result
Naïve Solution: Single Cluster
9#HWCSAIS14
EUEUQOFIF
Spark
Applications
Spark Cluster
Estimated Annual Cost
15 Million
M
S
S S
S S
Static cluster
No auto-scale
Problems of Single Static Cluster
10#HWCSAIS14
Application Executor Memory # Executors
1 2 GB 2
2 6 GB 80
3 12 GB 48
Wasted memory12GB2GBRunning:
App Executor12GBQueueing:
Cluster Size
Improvement: Multiple Clusters
11#HWCSAIS14
EUEUQOFIF
Small
Applications
EUEUQOFIF
Large
Applications
12GB Executors
2GB Executors
M
S
S S
S S
M
S
S S
S S
Estimated Annual Cost
12 Million
Further Reduce Cost
12#HWCSAIS14
Operational cost
• Loss of spot
• Job failure
Estimated Annual Cost
8 Million
Cloud cost
• Spot instances
• Smaller cluster
Drawbacks of Static Allocation
13#HWCSAIS14
Fixed Size
Always On
Over capacity
Under capacity
Maintenance Cost
Human Cost
Cloud Cost
Can We Go Dynamic?
14#HWCSAIS14
Why Not?
More Requirements
• Product features
– Affect module dependencies
• Job priority
– SLA assurance
15#HWCSAIS14
High priority Normal priority
Product A Product B
DataVisor SparkGen
16#HWCSAIS14
DataVisor SparkGen
17#HWCSAIS14
Prod Job
Scheduler Spark
Resource
Manager
Prod Jobs
Dev Jobs
Developers
M
S
S S
M
S
S S
S S
M
S S
S S
Estimated Annual Cost
3 Million
Cost Equations
Cost = Machine Cost + Human Cost
Machine Cost = Machine Up Time x Unit Price
Human Cost = Operation Overhead
18#HWCSAIS14
Reduce Machine Up Time
Single Static Cluster
⊕ One-time launch
⊖ Low utilization
⊖ Idle time
19#HWCSAIS14
Multiple Static Clusters
⊕ One-time launch
Moderate utilization
⊖ Idle time
One Job Per Cluster
⊖ Per-job launch
⊕ High utilization
⊕ No idle time
⊕ Dynamic max concurrency
⊕ No inter-job interference
⊕ Low maintenance overhead
⊖ Limited concurrency
⊖ Inter-job interference
⊖ High maintenance overhead
⊖ Limited concurrency
⊖ Inter-job interference
⊖ High maintenance overhead
60% Saving
Job JobLaunch
Time
Utilization
1
0
Idle Idle
Under-utilized Resource
Idle
Reduce Launch Time
• Pre-built AMI
– Systems & libs (dockerized)
– Pre-configured (non-runtime)
• Concurrent master/slave
initialization
• Result: 30 min → 3 min
20#HWCSAIS14
Amazon Machine Image (AMI)
Docker Docker
Spark Ganglia
Docker
Libs
Slave Initialization (2 phases)
1 2
Require Master Ready
• Phase 1
• Launch instance
• Upload runtime configuration
• Start services (local)
• Phase 2
• Start services (connect to master)
Sequential Launch Time
Master Init 1 2 1 2
Concurrent
Launch Time
Master Init
1
1
2
2
Maximize Job Concurrency
21#HWCSAIS14
A
D
C F G
B E
J
K
I
M
L
H
A
B
C
D
E
F G J
H
K M
I L
A B C D E F G H I LJ K M
Sequential
2X lower latency
Eliminate prioritization issue
Time
Time
One Job Per Cluster
Cost Equations
Cost = Machine Cost + Human Cost
Machine Cost = Machine Up Time x Unit Price
Human Cost = Operation Overhead
22#HWCSAIS14
Reduce Unit Price
• Spot Slaves (75% Saving)
• Reserved Masters (40% Saving)
23#HWCSAIS14
0 0.1 0.2 0.3 0.4 0.5 0.6
SPOT
RESERVED
ON DEMAND
R4.2XLARGE HOURLY $
Cost Equations
Cost = Machine Cost + Human Cost
Machine Cost = Machine Up Time x Unit Price
Human Cost = Operation Overhead
24#HWCSAIS14
Reduce Operation Overhead
• One Job Per Cluster
– Dynamic scale out
– No inter-job interference
– Easy patch/re-launch clusters
– Spot Fleet
• Higher availability (diversified)
• Maintain minimum capacity
25#HWCSAIS14
zone a, r4.2xlarge
zone b, r4.8xlarge
zone c, r4.xlarge
zone b, r4.4xlarge
zone b, r4.2xlarge
Why Not Yarn?
• Compared to One Job Per Cluster
– Single-point of failure (Master)
– Slower to scale
– One more system to configure / maintain
26#HWCSAIS14
Job Scheduler
27#HWCSAIS14
Spark
Resource
Manager
Product
Features
Auto Generate
Dependency
Simple Per-client Spec
Results
28#HWCSAIS14
40
10
0
10
20
30
40
50
12
6
0
5
10
15
Peak Scale
# of Spark executors
Cloud Cost
Annual cost in USD
Ops Cost
Weekly man-hour
Pipeline Latency
End-to-end hours
4X
5X 4X
2X1
4
0
1
2
3
4
5 THOUSANDS
15
3
0
5
10
15
20 MILLIONS
Q & A
29#HWCSAIS14
www.datavisor.com

More Related Content

What's hot (20)

PDF
Apache Spark Performance is too hard. Let's make it easier
Databricks
 
PDF
Metrics-Driven Tuning of Apache Spark at Scale with Edwina Lu and Ye Zhou
Databricks
 
PDF
Spark Summit EU talk by Ruben Pulido Behar Veliqi
Spark Summit
 
PPTX
Real time data viz with Spark Streaming, Kafka and D3.js
Ben Laird
 
PDF
Spark and Spark Streaming at Netfix-(Kedar Sedekar and Monal Daxini, Netflix)
Spark Summit
 
PDF
Apache Spark Acceleration Using Hardware Resources in the Cloud, Seamlessl wi...
Databricks
 
PDF
Spark Summit EU talk by Michael Nitschinger
Spark Summit
 
PDF
Opaque: A Data Analytics Platform with Strong Security: Spark Summit East tal...
Spark Summit
 
PDF
Deep Dive Into Apache Spark Multi-User Performance Michael Feiman, Mikhail Ge...
Databricks
 
PDF
The Key to Machine Learning is Prepping the Right Data with Jean Georges Perrin
Databricks
 
PDF
Scaling Apache Spark on Kubernetes at Lyft
Databricks
 
PDF
Large Scale Feature Aggregation Using Apache Spark with Pulkit Bhanot and Ami...
Databricks
 
PDF
Running Apache Spark on a High-Performance Cluster Using RDMA and NVMe Flash ...
Databricks
 
PDF
Structured-Streaming-as-a-Service with Kafka, YARN, and Tooling with Jim Dowling
Databricks
 
PDF
Accelerated Spark on Azure: Seamless and Scalable Hardware Offloads in the C...
Databricks
 
PDF
Challenging Web-Scale Graph Analytics with Apache Spark with Xiangrui Meng
Databricks
 
PDF
Advanced Natural Language Processing with Apache Spark NLP
Databricks
 
PDF
Apache Spark on K8S Best Practice and Performance in the Cloud
Databricks
 
PDF
Using Apache Spark in the Cloud—A Devops Perspective with Telmo Oliveira
Spark Summit
 
PDF
Lessons Learned from Managing Thousands of Production Apache Spark Clusters w...
Databricks
 
Apache Spark Performance is too hard. Let's make it easier
Databricks
 
Metrics-Driven Tuning of Apache Spark at Scale with Edwina Lu and Ye Zhou
Databricks
 
Spark Summit EU talk by Ruben Pulido Behar Veliqi
Spark Summit
 
Real time data viz with Spark Streaming, Kafka and D3.js
Ben Laird
 
Spark and Spark Streaming at Netfix-(Kedar Sedekar and Monal Daxini, Netflix)
Spark Summit
 
Apache Spark Acceleration Using Hardware Resources in the Cloud, Seamlessl wi...
Databricks
 
Spark Summit EU talk by Michael Nitschinger
Spark Summit
 
Opaque: A Data Analytics Platform with Strong Security: Spark Summit East tal...
Spark Summit
 
Deep Dive Into Apache Spark Multi-User Performance Michael Feiman, Mikhail Ge...
Databricks
 
The Key to Machine Learning is Prepping the Right Data with Jean Georges Perrin
Databricks
 
Scaling Apache Spark on Kubernetes at Lyft
Databricks
 
Large Scale Feature Aggregation Using Apache Spark with Pulkit Bhanot and Ami...
Databricks
 
Running Apache Spark on a High-Performance Cluster Using RDMA and NVMe Flash ...
Databricks
 
Structured-Streaming-as-a-Service with Kafka, YARN, and Tooling with Jim Dowling
Databricks
 
Accelerated Spark on Azure: Seamless and Scalable Hardware Offloads in the C...
Databricks
 
Challenging Web-Scale Graph Analytics with Apache Spark with Xiangrui Meng
Databricks
 
Advanced Natural Language Processing with Apache Spark NLP
Databricks
 
Apache Spark on K8S Best Practice and Performance in the Cloud
Databricks
 
Using Apache Spark in the Cloud—A Devops Perspective with Telmo Oliveira
Spark Summit
 
Lessons Learned from Managing Thousands of Production Apache Spark Clusters w...
Databricks
 

Similar to Managing Thousands of Spark Workers in Cloud Environment with Yuhao Zheng and Boduo Li (20)

PDF
Apache Spark At Scale in the Cloud
Rose Toomey
 
PDF
Apache Spark At Scale in the Cloud
Databricks
 
PPTX
Managed Cluster Services
Adam Doyle
 
PDF
Steps to Modernize Your Data Ecosystem with Mindtree Blog
sameerroshan
 
PDF
6 Steps to Modernize Data Ecosystem with Mindtree
devraajsingh
 
PDF
Steps to Modernize Your Data Ecosystem | Mindtree
AnikeyRoy
 
PDF
Six Steps to Modernize Your Data Ecosystem - Mindtree
samirandev1
 
PPTX
Activeeon technology for Big Compute and cloud migration
Activeeon
 
PPTX
Harness the Power of the Cloud for Grid Computing and Batch Processing Applic...
RightScale
 
PDF
Architecting a Scalable Hadoop Platform: Top 10 considerations for success
DataWorks Summit
 
PPTX
AWS Cost Optimization
Miles Ward
 
PDF
Hadoop Summit San Jose 2015: What it Takes to Run Hadoop at Scale Yahoo Persp...
Sumeet Singh
 
PDF
Serverless Machine Learning on Modern Hardware Using Apache Spark with Patric...
Databricks
 
PDF
Leverage High Performance Cloud Computing for your business! | Sysfore
Sysfore Technologies
 
PDF
Hadoop Summit Brussels 2015: Architecting a Scalable Hadoop Platform - Top 10...
Sumeet Singh
 
PDF
Evolutionary Multi-Goal Workflow Progress in Shade
IRJET Journal
 
PDF
Lessons Learned from Deploying Apache Spark as a Service on IBM Power Systems...
Indrajit Poddar
 
PPTX
Взгляд на облака с точки зрения HPC
Olga Lavrentieva
 
PDF
Migratory Workloads Across Clouds with Nomad
Philip Watts
 
PPT
Cloud Computing with .Net
Wesley Faler
 
Apache Spark At Scale in the Cloud
Rose Toomey
 
Apache Spark At Scale in the Cloud
Databricks
 
Managed Cluster Services
Adam Doyle
 
Steps to Modernize Your Data Ecosystem with Mindtree Blog
sameerroshan
 
6 Steps to Modernize Data Ecosystem with Mindtree
devraajsingh
 
Steps to Modernize Your Data Ecosystem | Mindtree
AnikeyRoy
 
Six Steps to Modernize Your Data Ecosystem - Mindtree
samirandev1
 
Activeeon technology for Big Compute and cloud migration
Activeeon
 
Harness the Power of the Cloud for Grid Computing and Batch Processing Applic...
RightScale
 
Architecting a Scalable Hadoop Platform: Top 10 considerations for success
DataWorks Summit
 
AWS Cost Optimization
Miles Ward
 
Hadoop Summit San Jose 2015: What it Takes to Run Hadoop at Scale Yahoo Persp...
Sumeet Singh
 
Serverless Machine Learning on Modern Hardware Using Apache Spark with Patric...
Databricks
 
Leverage High Performance Cloud Computing for your business! | Sysfore
Sysfore Technologies
 
Hadoop Summit Brussels 2015: Architecting a Scalable Hadoop Platform - Top 10...
Sumeet Singh
 
Evolutionary Multi-Goal Workflow Progress in Shade
IRJET Journal
 
Lessons Learned from Deploying Apache Spark as a Service on IBM Power Systems...
Indrajit Poddar
 
Взгляд на облака с точки зрения HPC
Olga Lavrentieva
 
Migratory Workloads Across Clouds with Nomad
Philip Watts
 
Cloud Computing with .Net
Wesley Faler
 
Ad

More from Databricks (20)

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

Recently uploaded (20)

PPTX
Numbers of a nation: how we estimate population statistics | Accessible slides
Office for National Statistics
 
PPTX
GenAI-Introduction-to-Copilot-for-Bing-March-2025-FOR-HUB.pptx
cleydsonborges1
 
PPTX
AI Presentation Tool Pitch Deck Presentation.pptx
ShyamPanthavoor1
 
PDF
Avatar for apidays apidays PRO June 07, 2025 0 5 apidays Helsinki & North 2...
apidays
 
PPTX
Introduction to Artificial Intelligence.pptx
StarToon1
 
PPTX
The _Operations_on_Functions_Addition subtruction Multiplication and Division...
mdregaspi24
 
DOC
MATRIX_AMAN IRAWAN_20227479046.docbbbnnb
vanitafiani1
 
PPTX
apidays Munich 2025 - Building Telco-Aware Apps with Open Gateway APIs, Subhr...
apidays
 
PDF
Context Engineering for AI Agents, approaches, memories.pdf
Tamanna
 
PPT
Lecture 2-1.ppt at a higher learning institution such as the university of Za...
rachealhantukumane52
 
PDF
WEF_Future_of_Global_Fintech_Second_Edition_2025.pdf
AproximacionAlFuturo
 
PPTX
Resmed Rady Landis May 4th - analytics.pptx
Adrian Limanto
 
PPT
01 presentation finyyyal معهد معايره.ppt
eltohamym057
 
PDF
apidays Helsinki & North 2025 - Monetizing AI APIs: The New API Economy, Alla...
apidays
 
PDF
Web Scraping with Google Gemini 2.0 .pdf
Tamanna
 
PPTX
Climate Action.pptx action plan for climate
justfortalabat
 
PPTX
Advanced_NLP_with_Transformers_PPT_final 50.pptx
Shiwani Gupta
 
PDF
apidays Helsinki & North 2025 - REST in Peace? Hunting the Dominant Design fo...
apidays
 
PDF
How to Connect Your On-Premises Site to AWS Using Site-to-Site VPN.pdf
Tamanna
 
PPTX
recruitment Presentation.pptxhdhshhshshhehh
devraj40467
 
Numbers of a nation: how we estimate population statistics | Accessible slides
Office for National Statistics
 
GenAI-Introduction-to-Copilot-for-Bing-March-2025-FOR-HUB.pptx
cleydsonborges1
 
AI Presentation Tool Pitch Deck Presentation.pptx
ShyamPanthavoor1
 
Avatar for apidays apidays PRO June 07, 2025 0 5 apidays Helsinki & North 2...
apidays
 
Introduction to Artificial Intelligence.pptx
StarToon1
 
The _Operations_on_Functions_Addition subtruction Multiplication and Division...
mdregaspi24
 
MATRIX_AMAN IRAWAN_20227479046.docbbbnnb
vanitafiani1
 
apidays Munich 2025 - Building Telco-Aware Apps with Open Gateway APIs, Subhr...
apidays
 
Context Engineering for AI Agents, approaches, memories.pdf
Tamanna
 
Lecture 2-1.ppt at a higher learning institution such as the university of Za...
rachealhantukumane52
 
WEF_Future_of_Global_Fintech_Second_Edition_2025.pdf
AproximacionAlFuturo
 
Resmed Rady Landis May 4th - analytics.pptx
Adrian Limanto
 
01 presentation finyyyal معهد معايره.ppt
eltohamym057
 
apidays Helsinki & North 2025 - Monetizing AI APIs: The New API Economy, Alla...
apidays
 
Web Scraping with Google Gemini 2.0 .pdf
Tamanna
 
Climate Action.pptx action plan for climate
justfortalabat
 
Advanced_NLP_with_Transformers_PPT_final 50.pptx
Shiwani Gupta
 
apidays Helsinki & North 2025 - REST in Peace? Hunting the Dominant Design fo...
apidays
 
How to Connect Your On-Premises Site to AWS Using Site-to-Site VPN.pdf
Tamanna
 
recruitment Presentation.pptxhdhshhshshhehh
devraj40467
 

Managing Thousands of Spark Workers in Cloud Environment with Yuhao Zheng and Boduo Li

  • 1. Managing Thousands of Spark Workers in Cloud Environment #HWCSAIS14 Yuhao Zheng & Boduo Li, DataVisor
  • 2. 1 4 0 1 2 3 4 5 THOUSANDS How To 2#HWCSAIS14 15 3 0 5 10 15 20 MILLIONS 40 10 0 10 20 30 40 50 Peak Scale # of Spark executors Cloud Cost Annual cost in USD Ops Cost Weekly man-hour 4X 5X 4X
  • 3. 3#HWCSAIS14 • Focus on fraud detection • Founded in Dec 2013 • 100-person team
  • 4. Coordinated Online Attacks 4#HWCSAIS14 Crime Ring Malicious Accounts Loss: >50B/Year Transaction Fraud Fake Review Promotion Abuse Launch Attacks
  • 5. DataVisor: UML Fraud Detection 5#HWCSAIS14 Early Detection Catch incubated accounts High Coverage and Accuracy Detect all bad users in a campaign Unknown Attack Detection Catch unknown suspicious activities Unsupervised Machine Learning
  • 6. UML is Expensive 6#HWCSAIS14 Register Profile Login Trasaction … Data Clean, Feature Ext. User Events Feature Pool: Thousands of Features Behavior Pattern Profile Pattern Device Pattern application_freq application_time … … work_year_distrib marriage_distrib promoter_info … deviceid_distrib ip_usage devicetype_var … … … … !(#, %) = ( ) *) ∗ ,)(-. , -/) Clustering Analysis 01 = ( 1 !1(#, %) Association probability Clustering probability …
  • 7. Huge Data Volume 7#HWCSAIS14 3 Billion+ user accounts 600 Billion+ events and growing 3 Petabytes of data
  • 8. Schedule Dependency 8#HWCSAIS14 Pipeline Module Original Data Pipeline Module Pipeline Module Pipeline Module Pipeline Module Pipeline Module ~20 modules / client Original Data Detection Result
  • 9. Naïve Solution: Single Cluster 9#HWCSAIS14 EUEUQOFIF Spark Applications Spark Cluster Estimated Annual Cost 15 Million M S S S S S Static cluster No auto-scale
  • 10. Problems of Single Static Cluster 10#HWCSAIS14 Application Executor Memory # Executors 1 2 GB 2 2 6 GB 80 3 12 GB 48 Wasted memory12GB2GBRunning: App Executor12GBQueueing: Cluster Size
  • 11. Improvement: Multiple Clusters 11#HWCSAIS14 EUEUQOFIF Small Applications EUEUQOFIF Large Applications 12GB Executors 2GB Executors M S S S S S M S S S S S Estimated Annual Cost 12 Million
  • 12. Further Reduce Cost 12#HWCSAIS14 Operational cost • Loss of spot • Job failure Estimated Annual Cost 8 Million Cloud cost • Spot instances • Smaller cluster
  • 13. Drawbacks of Static Allocation 13#HWCSAIS14 Fixed Size Always On Over capacity Under capacity Maintenance Cost Human Cost Cloud Cost
  • 14. Can We Go Dynamic? 14#HWCSAIS14 Why Not?
  • 15. More Requirements • Product features – Affect module dependencies • Job priority – SLA assurance 15#HWCSAIS14 High priority Normal priority Product A Product B
  • 17. DataVisor SparkGen 17#HWCSAIS14 Prod Job Scheduler Spark Resource Manager Prod Jobs Dev Jobs Developers M S S S M S S S S S M S S S S Estimated Annual Cost 3 Million
  • 18. Cost Equations Cost = Machine Cost + Human Cost Machine Cost = Machine Up Time x Unit Price Human Cost = Operation Overhead 18#HWCSAIS14
  • 19. Reduce Machine Up Time Single Static Cluster ⊕ One-time launch ⊖ Low utilization ⊖ Idle time 19#HWCSAIS14 Multiple Static Clusters ⊕ One-time launch Moderate utilization ⊖ Idle time One Job Per Cluster ⊖ Per-job launch ⊕ High utilization ⊕ No idle time ⊕ Dynamic max concurrency ⊕ No inter-job interference ⊕ Low maintenance overhead ⊖ Limited concurrency ⊖ Inter-job interference ⊖ High maintenance overhead ⊖ Limited concurrency ⊖ Inter-job interference ⊖ High maintenance overhead 60% Saving Job JobLaunch Time Utilization 1 0 Idle Idle Under-utilized Resource Idle
  • 20. Reduce Launch Time • Pre-built AMI – Systems & libs (dockerized) – Pre-configured (non-runtime) • Concurrent master/slave initialization • Result: 30 min → 3 min 20#HWCSAIS14 Amazon Machine Image (AMI) Docker Docker Spark Ganglia Docker Libs Slave Initialization (2 phases) 1 2 Require Master Ready • Phase 1 • Launch instance • Upload runtime configuration • Start services (local) • Phase 2 • Start services (connect to master) Sequential Launch Time Master Init 1 2 1 2 Concurrent Launch Time Master Init 1 1 2 2
  • 21. Maximize Job Concurrency 21#HWCSAIS14 A D C F G B E J K I M L H A B C D E F G J H K M I L A B C D E F G H I LJ K M Sequential 2X lower latency Eliminate prioritization issue Time Time One Job Per Cluster
  • 22. Cost Equations Cost = Machine Cost + Human Cost Machine Cost = Machine Up Time x Unit Price Human Cost = Operation Overhead 22#HWCSAIS14
  • 23. Reduce Unit Price • Spot Slaves (75% Saving) • Reserved Masters (40% Saving) 23#HWCSAIS14 0 0.1 0.2 0.3 0.4 0.5 0.6 SPOT RESERVED ON DEMAND R4.2XLARGE HOURLY $
  • 24. Cost Equations Cost = Machine Cost + Human Cost Machine Cost = Machine Up Time x Unit Price Human Cost = Operation Overhead 24#HWCSAIS14
  • 25. Reduce Operation Overhead • One Job Per Cluster – Dynamic scale out – No inter-job interference – Easy patch/re-launch clusters – Spot Fleet • Higher availability (diversified) • Maintain minimum capacity 25#HWCSAIS14 zone a, r4.2xlarge zone b, r4.8xlarge zone c, r4.xlarge zone b, r4.4xlarge zone b, r4.2xlarge
  • 26. Why Not Yarn? • Compared to One Job Per Cluster – Single-point of failure (Master) – Slower to scale – One more system to configure / maintain 26#HWCSAIS14
  • 28. Results 28#HWCSAIS14 40 10 0 10 20 30 40 50 12 6 0 5 10 15 Peak Scale # of Spark executors Cloud Cost Annual cost in USD Ops Cost Weekly man-hour Pipeline Latency End-to-end hours 4X 5X 4X 2X1 4 0 1 2 3 4 5 THOUSANDS 15 3 0 5 10 15 20 MILLIONS