efficient management of ephemeral data in …...serverless spark – add serverless properties to...

38
Patrick Stuedi IBM Research Efficient Management of Ephemeral Data in Serverless Computing

Upload: others

Post on 24-May-2020

4 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Efficient Management of Ephemeral Data in …...Serverless Spark – Add serverless properties to Spark (elasticity, on-demand scaling, etc) Pocket: elastic ephemeral storage for the

Patrick Stuedi IBM Research

Efficient Management of Ephemeral Data in Serverless Computing

Page 2: Efficient Management of Ephemeral Data in …...Serverless Spark – Add serverless properties to Spark (elasticity, on-demand scaling, etc) Pocket: elastic ephemeral storage for the

● Serverless frameworks are increasingly being used for interactive analytics

Exploit massive parallelism with large number of serverless tasks

Serverless Analytics

Page 3: Efficient Management of Ephemeral Data in …...Serverless Spark – Add serverless properties to Spark (elasticity, on-demand scaling, etc) Pocket: elastic ephemeral storage for the

● Serverless frameworks are increasingly being used for interactive analytics– Exploit massive parallelism with large number of serverless

tasks

Serverless Analytics

Page 4: Efficient Management of Ephemeral Data in …...Serverless Spark – Add serverless properties to Spark (elasticity, on-demand scaling, etc) Pocket: elastic ephemeral storage for the

● Serverless analytics involve multiple stages of execution

● Serverless tasks need an efficient way to communicated intermediate data between different stages

Challenge: Data Sharing

ephemeral data

Page 5: Efficient Management of Ephemeral Data in …...Serverless Spark – Add serverless properties to Spark (elasticity, on-demand scaling, etc) Pocket: elastic ephemeral storage for the

● Ephemeral data is exchanged directly between the tasks

In traditional analytics..

mapper0

mapper1

mapper2

mapper3

reducer0

reducer1

Page 6: Efficient Management of Ephemeral Data in …...Serverless Spark – Add serverless properties to Spark (elasticity, on-demand scaling, etc) Pocket: elastic ephemeral storage for the

● Direct communication between serverless tasks is difficult

– Tasks are short lived and stateless

In serverless analytics..

mapper0

mapper1

mapper2

mapper3

reducer0

reducer1?

Page 7: Efficient Management of Ephemeral Data in …...Serverless Spark – Add serverless properties to Spark (elasticity, on-demand scaling, etc) Pocket: elastic ephemeral storage for the

● Direct communication between serverless tasks is difficult

– Tasks are short lived and stateless

In serverless analytics..

mapper0

mapper1

mapper2

reducer0

reducer1

Page 8: Efficient Management of Ephemeral Data in …...Serverless Spark – Add serverless properties to Spark (elasticity, on-demand scaling, etc) Pocket: elastic ephemeral storage for the

● Direct communication between serverless tasks is difficult

– Tasks are short lived and stateless

In serverless analytics..

mapper0

mapper1

mapper2

reducer0

reducer1

Page 9: Efficient Management of Ephemeral Data in …...Serverless Spark – Add serverless properties to Spark (elasticity, on-demand scaling, etc) Pocket: elastic ephemeral storage for the

● High performance for a wide range of object sizes

Exploit massive parallelism with large number of serverless tasks

Requirements for Ephemeral Storage1

Page 10: Efficient Management of Ephemeral Data in …...Serverless Spark – Add serverless properties to Spark (elasticity, on-demand scaling, etc) Pocket: elastic ephemeral storage for the

● High performance for a wide range of object sizes● Fine grain, pay what you use resource billing

Requirements for Ephemeral Storage1

2

Example of performance-cost

tradeoff for a serverless

video analytics application

Page 11: Efficient Management of Ephemeral Data in …...Serverless Spark – Add serverless properties to Spark (elasticity, on-demand scaling, etc) Pocket: elastic ephemeral storage for the

● High performance for a wide range of object sizes● Fine grain, pay what you use resource billing● Fault-tolerance

Requirements for Ephemeral Storage1

2

3

Page 12: Efficient Management of Ephemeral Data in …...Serverless Spark – Add serverless properties to Spark (elasticity, on-demand scaling, etc) Pocket: elastic ephemeral storage for the

● High performance for a wide range of object sizes● Fine grain, pay what you use resource billing● Fault-tolerance

Requirements for Ephemeral Storage1

2

3

Existing cloud storage systems do not meet the elasticity, performance and cost demands of serverless analytics jobs

Page 13: Efficient Management of Ephemeral Data in …...Serverless Spark – Add serverless properties to Spark (elasticity, on-demand scaling, etc) Pocket: elastic ephemeral storage for the

● Serverless Spark – Add serverless properties to Spark (elasticity, on-

demand scaling, etc)● Pocket: elastic ephemeral storage for the cloud

– Improve applications running on serverless frameworks in the cloud (AWS λ, IBM Cloud Functions, etc)

Serverless Analytics: 2 Projects

1

2

Page 14: Efficient Management of Ephemeral Data in …...Serverless Spark – Add serverless properties to Spark (elasticity, on-demand scaling, etc) Pocket: elastic ephemeral storage for the

Project 1:

Spark Serverless Motivation

AWS Lambda Spark Serverless Spark Cloud On-Premise On-Premise0

100

200

300

400

500

Increasing flexibilityIncreasing performance

Example: Sorting 100GB

AWS λ Databricks Databricks Spark Spark Serverless Standard On-premise On-premise++

Spark/On-Premise++: Running Apache Spark on a High-Performance Cluster using RDMA and NVMe Flash, Spark Summit’17

Run

time

[se

cond

s]

Page 15: Efficient Management of Ephemeral Data in …...Serverless Spark – Add serverless properties to Spark (elasticity, on-demand scaling, etc) Pocket: elastic ephemeral storage for the

put your #assignedhashtag here by setting the footer in view-header/footer● Scheduler: when to best add/remove resources?

● Container startup: may have to dynamically spin up containers

● Storage overheads: – Input data needs to be fetched from remote storage (e.g., S3)

– Intermediate needs to be temporarily stored on remote storage (S3, Redis)

Why is it so hard?

Page 16: Efficient Management of Ephemeral Data in …...Serverless Spark – Add serverless properties to Spark (elasticity, on-demand scaling, etc) Pocket: elastic ephemeral storage for the

I/O Overhead: Sorting 100GB

AWS Lambda Spark Serverless Spark Cloud Spark Cluster Spark HPC0

100

200

300

400

500 Shuffle I/OComputeInput/Output

60%

22%

18%

Spark Cluster Spark HPC0

10

20

30

40

50

60

Shuffle overheads are significantly higher when intermediate data is stored remotely

19%

49%

32%

38%3%59% AWS λ Databricks Databricks Spark Spark

Serverless Standard On-premise On-premise++ Spark Spark On-premise On-premise++

Run

time

[se

cond

s]

Page 17: Efficient Management of Ephemeral Data in …...Serverless Spark – Add serverless properties to Spark (elasticity, on-demand scaling, etc) Pocket: elastic ephemeral storage for the

Instead of improving performance of serverless frameworks, can we…● ...add serverless properties to Spark?

– Elasticity, on-demand scaling– Sharing of a Spark resources (compute, memory) among users

● Use Case:– Enable sharing of Spark deployment among many users in a company,

research lab, etc.● Challenge:

– Maintain original Spark performance

Spark Serverless: Idea

Page 18: Efficient Management of Ephemeral Data in …...Serverless Spark – Add serverless properties to Spark (elasticity, on-demand scaling, etc) Pocket: elastic ephemeral storage for the

Spark Serverless: What’s missing?

SparkContext

Task

Executor

Worker

In-memorycache(MemStore)

Filesystem

Task

Executor

Worker

Task

Executor

Worker

Page 19: Efficient Management of Ephemeral Data in …...Serverless Spark – Add serverless properties to Spark (elasticity, on-demand scaling, etc) Pocket: elastic ephemeral storage for the

Spark Serverless: What’s missing?

SparkContext

Task

Executor

Worker

In-memorycache(MemStore)

Filesystem

Task

Executor

Worker

Task

Executor

Worker

loosingIntermediatedata/state!Scale-down

event

Page 20: Efficient Management of Ephemeral Data in …...Serverless Spark – Add serverless properties to Spark (elasticity, on-demand scaling, etc) Pocket: elastic ephemeral storage for the

Disaggregation of Ephemeral Data

SparkContext

Task

Executor

Worker

Task

Executor

Worker

Task

Executor

Worker

Network Fabric

DisaggregatedStorage

DRAM tier

Flash tier

Page 21: Efficient Management of Ephemeral Data in …...Serverless Spark – Add serverless properties to Spark (elasticity, on-demand scaling, etc) Pocket: elastic ephemeral storage for the

Disaggregation of Ephemeral Data

SparkContext

Task

Executor

Worker

Task

Executor

Worker

Task

Executor

Worker

Network Fabric

DisaggregatedStorage

DRAM tier

Flash tier

Scale-downevent Data/state

availablewhen

executordisappears

Page 22: Efficient Management of Ephemeral Data in …...Serverless Spark – Add serverless properties to Spark (elasticity, on-demand scaling, etc) Pocket: elastic ephemeral storage for the

Spark-Serverless Architecture

Driver HCS/Scheduler

ExecutorDRAMtier

Intermediate data

Intermediatedata

send schedule

register

Flashtier

send job DAG

register

assignapplication

register

launch task

crail.apache.org

Page 23: Efficient Management of Ephemeral Data in …...Serverless Spark – Add serverless properties to Spark (elasticity, on-demand scaling, etc) Pocket: elastic ephemeral storage for the

Architecture Overview

Driver HCS/Scheduler

ExecutorDRAMtier

send schedule

register

Flashtier

send job DAG

register

assignapplication

register

launch task

crail.apache.org

Intermediatedata

Intermediate data

Page 24: Efficient Management of Ephemeral Data in …...Serverless Spark – Add serverless properties to Spark (elasticity, on-demand scaling, etc) Pocket: elastic ephemeral storage for the

Architecture Overview

Driver HCS/Scheduler

ExecutorDRAMtier

send schedule

register

Flashtier

send job DAG

register

assignapplication

register

launch task

crail.apache.org

Intermediatedata

Intermediate data

Page 25: Efficient Management of Ephemeral Data in …...Serverless Spark – Add serverless properties to Spark (elasticity, on-demand scaling, etc) Pocket: elastic ephemeral storage for the

Architecture Overview

Driver HCS/Scheduler

ExecutorDRAMtier

send schedule

register

Flashtier

send job DAG

register

assignapplication

register

launch task

Executors getdynamically

re-assigned toapps/drivers

crail.apache.org

Intermediatedata

Intermediate data

Page 26: Efficient Management of Ephemeral Data in …...Serverless Spark – Add serverless properties to Spark (elasticity, on-demand scaling, etc) Pocket: elastic ephemeral storage for the

Video: Putting things together

Application 1:GridSearch

Application 2:SQL TPC-DS

Application 3:SQL TPC-DS

HCLScheduler

Resource view:fraction of resourceseach app consumes

Executor view:Which app an executorcurrently runs

Page 27: Efficient Management of Ephemeral Data in …...Serverless Spark – Add serverless properties to Spark (elasticity, on-demand scaling, etc) Pocket: elastic ephemeral storage for the

Scheduling SnapshotE

xecu

tors

Time

Grid SearchSQL

Page 28: Efficient Management of Ephemeral Data in …...Serverless Spark – Add serverless properties to Spark (elasticity, on-demand scaling, etc) Pocket: elastic ephemeral storage for the

put your #assignedhashtag here by setting the footer in view-header/footer● Compute cluster size: 8 nodes: IBM Power8 Minsky

● Storage cluster size: 8 nodes, IBM Power8 Minsky

● Cluster hardware:– DRAM: 512 GB

– Storage: 4x 1.2 TB NVMe SSD

– Network: 10Gb/s Ethernert, 100Gb/s RoCE

– GPU: NVIDIA P100, NVLink

● Workload– SQL: TCP-DS

Let’s look at performance...

Page 29: Efficient Management of Ephemeral Data in …...Serverless Spark – Add serverless properties to Spark (elasticity, on-demand scaling, etc) Pocket: elastic ephemeral storage for the

Spark-SQL: TPC-DS (Query #87)(long running query)

Spark Cluster Simple Serverless HCS/CRAIL/TCP HCS/CRAIL/RDMA0

2

4

6

8

10

12

14R

untim

e [s

econ

ds]

VanillaCluster

HCS/CrailTCP,10Gb/s

HCS/CrailTCP,100Gb/s

HCS/CrailRDMA,100Gb/s

Efficiently disaggregating ephemeral data enables Spark cluster to grow and shrink without a performance cost

Page 30: Efficient Management of Ephemeral Data in …...Serverless Spark – Add serverless properties to Spark (elasticity, on-demand scaling, etc) Pocket: elastic ephemeral storage for the

Runtime [seconds]

Short-running queries benefit from the shared (already-up) Spark deployment

Spark-SQL: TPC-DS (Query #3)(short running query)

Warm serverless

Crail Serverless

Spark Cluster

0 5 10 15 20 25 30 35

queryruntime

jobruntime

Page 31: Efficient Management of Ephemeral Data in …...Serverless Spark – Add serverless properties to Spark (elasticity, on-demand scaling, etc) Pocket: elastic ephemeral storage for the

● Context: Serverless analytics in the cloud – AWS λ, IBM Cloud Functions, Azure Functions

● Current practice for storing ephemeral data:– S3:

● High latencies for small data sets– Redis, AWS ElasticCache:

● Inconvenient for storing large objects● No dynamic scaling● Costly (DRAM)

● Can we use Apache Crail?– Not as is, no dynamic scaling

Project 2:

Serverless Analytics in the Cloud

Page 32: Efficient Management of Ephemeral Data in …...Serverless Spark – Add serverless properties to Spark (elasticity, on-demand scaling, etc) Pocket: elastic ephemeral storage for the

Pocket

Resource usage ($/hr)

Exe

cutio

n tim

e (s

ec)

Pocket dynamicallyrightsizes storageresources (nodes,

media) in an attemptto find a spot with agood performance

price ratio

● An elastic distributed data store for ephemeral data sharing in serverless analytics

Page 33: Efficient Management of Ephemeral Data in …...Serverless Spark – Add serverless properties to Spark (elasticity, on-demand scaling, etc) Pocket: elastic ephemeral storage for the

How Pocket works

Page 34: Efficient Management of Ephemeral Data in …...Serverless Spark – Add serverless properties to Spark (elasticity, on-demand scaling, etc) Pocket: elastic ephemeral storage for the

Pocket: Resource Utilization● Comparing Pocket to S3 and Redis

Page 35: Efficient Management of Ephemeral Data in …...Serverless Spark – Add serverless properties to Spark (elasticity, on-demand scaling, etc) Pocket: elastic ephemeral storage for the

Autoscaling a Pocket Cluster

Page 36: Efficient Management of Ephemeral Data in …...Serverless Spark – Add serverless properties to Spark (elasticity, on-demand scaling, etc) Pocket: elastic ephemeral storage for the

put your #assignedhashtag here by setting the footer in view-header/footer● Serverless frameworks are increasingly being used for interactive analytics

● Efficiently managing ephemeral data is important for serverless analytics

2 Projects:

● Spark-serverless– Add support to Spark for fine-grained on-demand scaling

– Permit growing/shrinking of Spark executors by disaggregating shuffle data using Apache Crail

● Pocket– Elastic distributed data store for ephemeral data sharing in serverless analytics

– Can be used together with frameworks like AWS λ, IBM Cloud Functions, etc.

Conclusion

Page 37: Efficient Management of Ephemeral Data in …...Serverless Spark – Add serverless properties to Spark (elasticity, on-demand scaling, etc) Pocket: elastic ephemeral storage for the

put your #assignedhashtag here by setting the footer in view-header/footer● Pocket: Ephemeral Storage for Serverless Analytics, OSDI’18

● Navigating Storage for Serverless Computing, Usenix ATC’18

● Crail: A High-Performance I/O Architecture for Distributed Data Processing, IEEE Data Bulletin 2017

● Running Apache Spark on a High-Performance Cluster Using RDMA and NVMe Flash, Spark Summit’17

● Serverless Machine Learning using Crail, Spark Summit’18

● Apache Crail, http://crail.apache.org

References

Page 38: Efficient Management of Ephemeral Data in …...Serverless Spark – Add serverless properties to Spark (elasticity, on-demand scaling, etc) Pocket: elastic ephemeral storage for the

Thanks to

Ana Klimovic, Yawen Wang, Michael Kaufmann, Adrian Schuepbach, Jonas Pfefferle, Animesh Trivedi, Bernard Metzler

Slides (Intro & Pocket) from Pocket presentation (OSDI’18, Ana Klimovic)