Centralized Core-granular Scheduling for Serverless Functions Kostis - - PowerPoint PPT Presentation

centralized core granular scheduling for serverless
SMART_READER_LITE
LIVE PREVIEW

Centralized Core-granular Scheduling for Serverless Functions Kostis - - PowerPoint PPT Presentation

Centralized Core-granular Scheduling for Serverless Functions Kostis Kaffes , Neeraja J. Yadwadkar, Christos Kozyrakis Serverless Computing is Convenient for Users Users: Define a function Specify events as execution triggers Pay only


slide-1
SLIDE 1

Centralized Core-granular Scheduling for Serverless Functions

Kostis Kaffes, Neeraja J. Yadwadkar, Christos Kozyrakis

slide-2
SLIDE 2

Serverless Computing is Convenient for Users

Users:

  • Define a function
  • Specify events as execution triggers
  • Pay only for the actual runtime of the function activation

2

slide-3
SLIDE 3

Ease-of-use has made Serverless Prevalent

3

Compilation

gg (ATC ’19)

PyWren

(SoCC ‘17)

ExCamera

(NSDI ‘17)

User-facing apps Data Analytics Exotic Workloads

NFV

(HotNets ’18)

Sprocket

(SoCC ‘18)

slide-4
SLIDE 4

Serverless Functions’ Characteristics

  • Burstiness

à Degree of parallelism can fluctuate wildly

  • Short but highly-variable execution times

à Execution times vary from ms to minutes

  • Low or no intra-function parallelism

à Each function runs on at most a couple of CPUs

4

slide-5
SLIDE 5

Serverless Systems’ Performance Metrics

5

  • Elasticity

à Spawn a large number of functions in a short period of time

  • Average and Tail Latency

à User-facing workloads à High fan-out workloads

  • Cost Efficiency
slide-6
SLIDE 6

Serverless Computing is Challenging for Providers

6

Providers need to manage:

  • Function placement
  • Scaling
  • Runtime Environment
slide-7
SLIDE 7

Serverless Function Lifecycle

7

GATEWAY

Container

Servers Registry

Image Container

1 2 3 4 5

warm start cold start

slide-8
SLIDE 8

Different Approaches on Serverless Scheduling

8

  • Task scheduling frameworks (Sparrow, Canary)
  • Open-source serverless platforms (OpenFaas, Kubeless)
  • Commercial serverless platforms (AWS Lambda, Azure

Functions, Google Cloud Functions)

slide-9
SLIDE 9

Option 1: Task Scheduling Frameworks

Two-level Scheduling:

  • Simple load-balancer assigns tasks to servers
  • Per-machine agent detects imbalances and migrates tasks

away from busy servers

9 T T T

LB LB

T

slide-10
SLIDE 10

Task Scheduling Frameworks’ Problems

Such a design is unsuitable for serverless functions

  • High variability à Queue imbalances à Frequent migrations
  • High cold-start cost à Increased latency

10 T T T

LB LB

T

slide-11
SLIDE 11

Option 2: Open-source Serverless Schedulers

  • Gateway receives functions invocations
  • All container management is done by Kubernetes
  • No migrations

11

à Gateway Parameters

  • - Scaling policy
  • - Max/min # instances
  • - Timeouts

à Kubernetes parameters

  • - Container placement
  • - …

Scheduling split across multiple points Hard to configure Reduced elasticity and efficiency

slide-12
SLIDE 12

Option 3: Commercial Serverless Schedulers

  • Gateway packs containers running function invocations in VMs

to improve utilization

  • Once VM utilization exceeds some threshold, it spins up more

VMs in different servers

12

Opaque policies and decisions + Function packing = Unpredictable performance

slide-13
SLIDE 13

How can we avoid existing schedulers’ problems?

13

Problem: High variability leading to imbalances and queueing Solution: Centralized Scheduling and Queueing Problem: Hard or impossible to configure Problem: Coarse-scale scheduling can cause interference Solution: Core-Granular Scheduling

slide-14
SLIDE 14

Centralized and Core-granular Scheduling

Visibility of all available cores:

  • Less queueing
  • Lower latency
  • Higher elasticity

Fine-grain interference/utilization control:

  • Pack many function instances together to maximize

efficiency

  • Reduce interference by placing one function per core

14

slide-15
SLIDE 15

Opportunity 1: Inter-function Communication

15

Serverless workloads create data that need to be transferred between function instances Now: Data shared through a common data store Ideal: Direct function-to-function communication àNaming, addressing, and discovery through the centralized scheduler àAvoids an unnecessary data transfer and reduces cost

slide-16
SLIDE 16

Opportunity 2: Core Specialization

16

Centralized scheduler can keep a list of “warm” cores for:

  • Specific functions
  • Different language runtimes (Python, Javascript, etc.)
  • Different libraries and frameworks (numpy, scikit-learn)

and reduce cold start time

slide-17
SLIDE 17

Opportunity 3: “Smarter” Policies

17

The scheduler has full visibility on the cluster state It can use or learn better policies regarding:

  • Container re-use
  • Scaling
  • Function packing
slide-18
SLIDE 18

Conclusion

18

Centralized and core-granular scheduling can enable: àBetter elasticity àLower latency àHigher efficiency It also provides exciting opportunities for future research: àInter-function communication àCore Specialization à”Smarter” Policies

slide-19
SLIDE 19

Backup

19

slide-20
SLIDE 20

Detailed Implementation

  • i. Request arrives to a scheduler

core

  • ii. Dequeue worker core
  • iii. Schedule request to worker core
  • iv. Enqueue worker core
  • v. Request arrives to scheduler

core with empty worker core list

  • vi. Steal worker core from different

queue vii.Schedule request to worker core

20