Slide 1

Slide 1 text

The State of Serverless Computing or, Fixing Dysfunction-as-a-Service Vikram Sreekanti, Chenggang Wu RISE Lab, UC Berkeley Craft Conference – Budapest, Hungary – 05/09/2019

Slide 2

Slide 2 text

5th Graders Learning Programming San Diego, CA The State of Serverless Computing Craft Conference 2019 – Budapest, Hungary

Slide 3

Slide 3 text

UC Berkeley: CS 61A Fall 2018 The State of Serverless Computing Craft Conference 2019 – Budapest, Hungary

Slide 4

Slide 4 text

Making Programmers Productive Key Question: Where will code be run? In the ☁! The State of Serverless Computing Craft Conference 2019 – Budapest, Hungary

Slide 5

Slide 5 text

Background: Serverless Computing The State of Serverless Computing Craft Conference 2019 – Budapest, Hungary

Slide 6

Slide 6 text

What is serverless computing? Serverless computing is a programming abstraction that enables users to upload programs, run them at any scale, and pay only for resources used. The State of Serverless Computing Craft Conference 2019 – Budapest, Hungary

Slide 7

Slide 7 text

Functions-as-a-Service • AWS Lambda, Google Cloud Functions, OpenWhisk (IBM), Azure Functions, OpenLambda, OpenFaaS, kNative… • Optimized for simplicity – register functions, enable triggers, and scale transparently The State of Serverless Computing Craft Conference 2019 – Budapest, Hungary

Slide 8

Slide 8 text

FaaS: A Simple Example Upload Cloud Storage Generate thumbnail Save thumbnail Save path Cloud Storage Cloud Database Cloud Server The State of Serverless Computing Craft Conference 2019 – Budapest, Hungary

Slide 9

Slide 9 text

Why serverless? • Today’s cloud abstractions are hard to use • Application deployment tools have improved significantly • They are oriented towards infrastructure engineers, not application developers The State of Serverless Computing Craft Conference 2019 – Budapest, Hungary

Slide 10

Slide 10 text

The State of Serverless Computing Craft Conference 2019 – Budapest, Hungary Academic Interest in Serverless

Slide 11

Slide 11 text

The State of Serverless Computing Craft Conference 2019 – Budapest, Hungary Academic Interest in Serverless

Slide 12

Slide 12 text

Industrial Interest in Serverless The State of Serverless Computing Craft Conference 2019 – Budapest, Hungary

Slide 13

Slide 13 text

Industrial Interest in Serverless The State of Serverless Computing Craft Conference 2019 – Budapest, Hungary

Slide 14

Slide 14 text

The State of FaaS The State of Serverless Computing Craft Conference 2019 – Budapest, Hungary

Slide 15

Slide 15 text

What is FaaS good at today? f() f() f() f() Embarrassingly parallel tasks Workflow orchestration The State of Serverless Computing Craft Conference 2019 – Budapest, Hungary

Slide 16

Slide 16 text

Wait! What about… • There are other serverless services, too! • e.g., Google Cloud Dataflow, AWS Athena, Snowflake… • Often referred to as Backend-as-a-Service (BaaS) We’re primarily interested in generality. The State of Serverless Computing Craft Conference 2019 – Budapest, Hungary

Slide 17

Slide 17 text

No specialized hardware Limited execution lifetimes Limitations on FaaS Today Limited execution lifetimes No inbound network connections x IO is a bottleneck No specialized hardware The State of Serverless Computing Craft Conference 2019 – Budapest, Hungary

Slide 18

Slide 18 text

No specialized hardware Limited execution lifetimes Limitations on FaaS Today No inbound network connections x IO is a bottleneck The State of Serverless Computing Craft Conference 2019 – Budapest, Hungary

Slide 19

Slide 19 text

But that’s okay: Everything is functional! • Functional programs don’t have side effects or mutable state! • And it is called AWS Lambda The State of Serverless Computing Craft Conference 2019 – Budapest, Hungary

Slide 20

Slide 20 text

But that’s okay: Everything is functional! • Functional programs don’t have side effects or mutable state! • And it is called AWS Lambda NOT NOT The State of Serverless Computing Craft Conference 2019 – Budapest, Hungary

Slide 21

Slide 21 text

Dysfunction-as-a-Service • FaaS is not designed for functional programming because real applications share state • FaaS is poorly suited for all of these The State of Serverless Computing Craft Conference 2019 – Budapest, Hungary

Slide 22

Slide 22 text

Quantifying The Pain of FaaS How FaaS Disappoints Famous Computer Scientists The State of Serverless Computing Craft Conference 2019 – Budapest, Hungary

Slide 23

Slide 23 text

Even Functional Programming is Slow! Median and 99th percentile latencies for composing two arithmetic functions on AWS Lambda. 1 10 100 1000 Lambda (S3) Lambda (Dynamo) Lambda (Direct) AWS Step FNs Latency (ms) 285 239 737 573 The State of Serverless Computing Craft Conference 2019 – Budapest, Hungary

Slide 24

Slide 24 text

Even Functional Programming is Slow! Median and 99th percentile latencies for composing two arithmetic functions on AWS Lambda. 1 10 100 1000 Lambda (S3) Lambda (Dynamo) Lambda (Direct) AWS Step FNs Latency (ms) 285 239 79.6 737 573 178 The State of Serverless Computing Craft Conference 2019 – Budapest, Hungary

Slide 25

Slide 25 text

Even Functional Programming is Slow! Median and 99th percentile latencies for composing two arithmetic functions on AWS Lambda. 1 10 100 1000 Lambda (S3) Lambda (Dynamo) Lambda (Direct) AWS Step Fns Latency (ms) 285 239 79.6 569 737 573 178 3346 The State of Serverless Computing Craft Conference 2019 – Budapest, Hungary

Slide 26

Slide 26 text

Shared Mutable State The State of Serverless Computing Craft Conference 2019 – Budapest, Hungary

Slide 27

Slide 27 text

Shared Mutable Storage The State of Serverless Computing Craft Conference 2019 – Budapest, Hungary

Slide 28

Slide 28 text

Ideal Serverless Storage Autoscaling Low Latency The State of Serverless Computing Craft Conference 2019 – Budapest, Hungary

Slide 29

Slide 29 text

Ideal Serverless Storage Autoscaling Low Latency Tradeoff! The State of Serverless Computing Craft Conference 2019 – Budapest, Hungary

Slide 30

Slide 30 text

(In)Consistency Guarantees Shared Counter The State of Serverless Computing Craft Conference 2019 – Budapest, Hungary

Slide 31

Slide 31 text

(In)Consistency Guarantees Shared Counter ? The State of Serverless Computing Craft Conference 2019 – Budapest, Hungary

Slide 32

Slide 32 text

No Inbound Network Connections Easy Fault Tolerance Enables Process Migration The State of Serverless Computing Craft Conference 2019 – Budapest, Hungary

Slide 33

Slide 33 text

Indirect Communication Write Read The State of Serverless Computing Craft Conference 2019 – Budapest, Hungary

Slide 34

Slide 34 text

Indirect Communication Write Read The State of Serverless Computing Craft Conference 2019 – Budapest, Hungary

Slide 35

Slide 35 text

We can fix that! The State of Serverless Computing Craft Conference 2019 – Budapest, Hungary

Slide 36

Slide 36 text

A Platform for Stateful Serverless Computing The State of Serverless Computing Craft Conference 2019 – Budapest, Hungary

Slide 37

Slide 37 text

Background: Anna • High performance across orders of magnitude in scale ü10x faster than Redis/Cassandra in a geo-distributed deployment • Autoscaling & cost-efficient ü500x faster than Amazon DynamoDB for the same cost Chenggang Wu, Jose Faleiro, Yihan Lin, and Joseph M. Hellerstein. "Anna: A KVS for Any Scale." IEEE Transactions on Knowledge and Data Engineering (2019). Chenggang Wu, Vikram Sreekanti, and Joseph M. Hellerstein. "Autoscaling Tiered Cloud Storage in Anna." Proceedings of the VLDB Endowment 12, no. 6 (2019): 624-638. The State of Serverless Computing Craft Conference 2019 – Budapest, Hungary

Slide 38

Slide 38 text

Fluent: FaaS-over-Anna • Maintain disaggregation of compute & state • Make serverless a viable option for stateful applications • Use Anna for both storage and communication Anna The State of Serverless Computing Craft Conference 2019 – Budapest, Hungary

Slide 39

Slide 39 text

Fluent: FaaS-over-Anna Network Boundary Anna The State of Serverless Computing Craft Conference 2019 – Budapest, Hungary

Slide 40

Slide 40 text

Logical disaggregation with physical colocation The State of Serverless Computing Craft Conference 2019 – Budapest, Hungary

Slide 41

Slide 41 text

Fluent: FaaS-over-Anna Network Boundary Anna The State of Serverless Computing Craft Conference 2019 – Budapest, Hungary

Slide 42

Slide 42 text

Key Idea: Caching • Enable low-latency data access by caching data close to code execution • Communication (and composition) is achieved via a fast-path on top of KVS puts and gets The State of Serverless Computing Craft Conference 2019 – Budapest, Hungary

Slide 43

Slide 43 text

Challenge: Cache Consistency • tl;dr: we can provide a variety of coordination-avoiding consistency modes (e.g., causal consistency) – which is better than S3 or DynamoDB! • This is done by encapsulating program state in lattices • Happy to discuss this in more detail later The State of Serverless Computing Craft Conference 2019 – Budapest, Hungary

Slide 44

Slide 44 text

Function Composition, Revisited Median and 99th percentile latencies for composing two arithmetic functions on AWS Lambda and Fluent. 1 10 100 1000 Fluent Lambda (S3) Lambda (Dynamo) Lambda (Direct) AWS Step Fns Latency (ms) 3.59 285 239 79.6 569 6.37 737 573 178 3346 The State of Serverless Computing Craft Conference 2019 – Budapest, Hungary

Slide 45

Slide 45 text

Case Study: Prediction Serving The State of Serverless Computing Craft Conference 2019 – Budapest, Hungary

Slide 46

Slide 46 text

Prediction Serving • Generate predictions from pretrained machine learning models • At first blush, a great fit for serverless infrastructure Clean Input Join with Reference Data Model Replica Model Replica Model Replica Combine Results The State of Serverless Computing Craft Conference 2019 – Budapest, Hungary

Slide 47

Slide 47 text

The State of Serverless Computing Craft Conference 2019 – Budapest, Hungary

Slide 48

Slide 48 text

Background: SqueezeNet • State-of-the-art image classification model (developed at Berkeley!) The State of Serverless Computing Craft Conference 2019 – Budapest, Hungary

Slide 49

Slide 49 text

Prediction Serving Median and 99th percentile latencies for SqueezeNet on Fluent and AWS SageMaker. The State of Serverless Computing Craft Conference 2019 – Budapest, Hungary 0 50 100 150 200 250 300 350 400 Fluent Python AWS SageMaker Latency (ms) 90.6 153.8 282.2 122.9 156.3 361.7

Slide 50

Slide 50 text

The Future of Cloud Programming The State of Serverless Computing Craft Conference 2019 – Budapest, Hungary

Slide 51

Slide 51 text

Looking Back: Disappointed Computer Scientists • Functional programming is slow • Communication through slow storage • Poor consistency guarantees The State of Serverless Computing Craft Conference 2019 – Budapest, Hungary

Slide 52

Slide 52 text

Making FaaS Functional • Embrace state • Easy things become better • Hard things become easy A step on our road towards a programmable cloud. The State of Serverless Computing Craft Conference 2019 – Budapest, Hungary

Slide 53

Slide 53 text

Our Vision • Serverless will change the way that we write software and the way that programming infrastructure works • Cloud-native programming models • Enable users to take advantage of millions of cores and petabytes of RAM The State of Serverless Computing Craft Conference 2019 – Budapest, Hungary

Slide 54

Slide 54 text

Moving Forward from FaaS Developing Autoscaling Policy Designing SLOs & SLAs The State of Serverless Computing Craft Conference 2019 – Budapest, Hungary Building Developer Tools

Slide 55

Slide 55 text

Thanks! @vsreekan= @cgwu0530 [email protected] [email protected] fluent-project/fluent The State of Serverless Computing Craft Conference 2019 – Budapest, Hungary