medea: towards expressive scheduling of long …...expressive scheduling of m e ea long-running...

2
MEDEA: Towards Expressive Scheduling of Long-Running Applications Panagiotis Garefalakis Konstantinos Karanasos Peter Pietzuch Arun Suresh Sriram Rao Microsoft Imperial College London Applications with long-running containers are increas- ingly common in shared production clusters. Typical ex- amples include streaming, machine learning, and latency- sensitive applications with long-running executors for their tasks, as well as traditional online services. In fact, within Microsoft, we witness a substantial shift towards long- running applications (LRAs) in production clusters: analyz- ing four of Microsoft’s big data clusters we found that the fraction of LRAs was ranging from 9% to above 30%. These applications have stringent and complex schedul- ing requirements: application owners want placement de- cisions to respect complex constraints, e.g., co-locating or separating long-running containers across node groups, ac- counting for performance and resilience; cluster operators must also achieve global objectives, such as minimizing fu- ture regret, i.e., avoiding decisions that hinder placement of upcoming applications. All of this must be done without af- fecting the scheduling latency of short-running containers. Despite the evolution from predominantly batch jobs to a heterogeneous mix of applications, production clusters still optimize for achieving low-latency for batch jobs, ignoring the specific requirements of LRAs. To this end, we propose MEDEA, a new cluster scheduler with dedicated support for LRAs. MEDEA follows a two- scheduler design: (i) for LRAs, it applies an optimization- based approach with expressive placement constraints that captures interactions between containers within and across applications, while minimizing future regret; (ii) for short- running containers, MEDEA uses a traditional task-based scheduler to achieve low placement latency. Our implemen- tation as part of Apache Hadoop/YARN shows that MEDEA places LRAs effectively and in a scalable manner. Permission to make digital or hard copies of all or part of this work for personal or classroom use is granted without fee provided that copies are not made or distributed for profit or commercial advantage and that copies bear this notice and the full citation on the first page. Copyrights for components of this work owned by others than ACM must be honored. Abstracting with credit is permitted. To copy otherwise, or republish, to post on servers or to redistribute to lists, requires prior specific permission and/or a fee. Request permissions from [email protected]. EuroSys ’17, April 23–26, 2017, Belgrade, Serbia. Copyright © 20yy ACM 978-1-nnnn-nnnn-n/yy/mm. . . $15.00. http://dx.doi.org/10.1145/nnnnnnn.nnnnnnn MEDEA Scheduler LRAs Task-based jobs LRA Scheduler Task-based Scheduler Constraint Manager Cluster State Container placement Figure 1: MEDEA Scheduler design Key features MEDEA addresses the aforementioned re- quirements based on two novel features: (i) expressive, high-level constraints. We introduce the no- tions of container tags and node groups to allow applications to concisely express powerful constraints within and across applications. Constraints can refer to both existing and future applications, and no knowledge of the underlying cluster’s organization is required. (ii) two-scheduler design. We formulate the scheduling of LRAs as an optimization-based problem. As shown in Fig- ure 1, MEDEA uses a dedicated scheduler for the LRA place- ment, whereas task-based applications are passed directly to a traditional scheduler. This design allows us to perform careful placement of LRAs, which can tolerate relatively higher scheduling latencies, without impacting the schedul- ing of task-based applications. Implementation and evaluation We implemented MEDEA as an extension to Apache Hadoop/YARN, one of the most widely used production cluster managers. We show that on a 274-node cluster, MEDEA, thanks to its expressive con- straints, can reduce tail latency for HBase requests by 3and increase its throughput by 34% compared to YARN. Coupling MEDEA with resource isolation mechanisms, such as cgroups, can further improve its performance. Unlike single-scheduler designs, we show that MEDEA does not im- pact the scheduling latency of task-based applications. We are currently in the process of contributing MEDEA compo- nents to Apache Hadoop YARN 1 . 1 https://issues.apache.org/jira/browse/YARN-5468

Upload: others

Post on 22-May-2020

2 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: MEDEA: Towards Expressive Scheduling of Long …...Expressive Scheduling of M E EA Long-Running Applications A 0 50 100 150 200 B C D F E 0 50 100 150 200 250 300 YARN YARN-Cgroups

MEDEA: Towards Expressive Scheduling

of Long-Running Applications

Panagiotis Garefalakis†⇧ Konstantinos Karanasos† Peter Pietzuch⇧

Arun Suresh† Sriram Rao†

†Microsoft

⇧Imperial College London

Applications with long-running containers are increas-ingly common in shared production clusters. Typical ex-amples include streaming, machine learning, and latency-sensitive applications with long-running executors for theirtasks, as well as traditional online services. In fact, withinMicrosoft, we witness a substantial shift towards long-

running applications (LRAs) in production clusters: analyz-ing four of Microsoft’s big data clusters we found that thefraction of LRAs was ranging from 9% to above 30%.

These applications have stringent and complex schedul-ing requirements: application owners want placement de-cisions to respect complex constraints, e.g., co-locating orseparating long-running containers across node groups, ac-counting for performance and resilience; cluster operatorsmust also achieve global objectives, such as minimizing fu-

ture regret, i.e., avoiding decisions that hinder placement ofupcoming applications. All of this must be done without af-fecting the scheduling latency of short-running containers.

Despite the evolution from predominantly batch jobs to aheterogeneous mix of applications, production clusters stilloptimize for achieving low-latency for batch jobs, ignoringthe specific requirements of LRAs.

To this end, we propose MEDEA, a new cluster schedulerwith dedicated support for LRAs. MEDEA follows a two-scheduler design: (i) for LRAs, it applies an optimization-based approach with expressive placement constraints thatcaptures interactions between containers within and acrossapplications, while minimizing future regret; (ii) for short-running containers, MEDEA uses a traditional task-basedscheduler to achieve low placement latency. Our implemen-tation as part of Apache Hadoop/YARN shows that MEDEAplaces LRAs effectively and in a scalable manner.

Permission to make digital or hard copies of all or part of this work for personal orclassroom use is granted without fee provided that copies are not made or distributedfor profit or commercial advantage and that copies bear this notice and the full citationon the first page. Copyrights for components of this work owned by others than ACMmust be honored. Abstracting with credit is permitted. To copy otherwise, or republish,to post on servers or to redistribute to lists, requires prior specific permission and/or afee. Request permissions from [email protected] ’17, April 23–26, 2017, Belgrade, Serbia.Copyright © 20yy ACM 978-1-nnnn-nnnn-n/yy/mm. . . $15.00.http://dx.doi.org/10.1145/nnnnnnn.nnnnnnn

MEDEA Scheduler

LRAs

Task-based jobs

LRA Scheduler Task-based Scheduler

Constraint Manager Cluster State

Container placement

Figure 1: MEDEA Scheduler design

Key features MEDEA addresses the aforementioned re-quirements based on two novel features:(i) expressive, high-level constraints. We introduce the no-tions of container tags and node groups to allow applicationsto concisely express powerful constraints within and acrossapplications. Constraints can refer to both existing and futureapplications, and no knowledge of the underlying cluster’sorganization is required.(ii) two-scheduler design. We formulate the scheduling ofLRAs as an optimization-based problem. As shown in Fig-ure 1, MEDEA uses a dedicated scheduler for the LRA place-ment, whereas task-based applications are passed directlyto a traditional scheduler. This design allows us to performcareful placement of LRAs, which can tolerate relativelyhigher scheduling latencies, without impacting the schedul-ing of task-based applications.Implementation and evaluation We implemented MEDEAas an extension to Apache Hadoop/YARN, one of the mostwidely used production cluster managers. We show that ona 274-node cluster, MEDEA, thanks to its expressive con-straints, can reduce tail latency for HBase requests by 3⇥and increase its throughput by 34% compared to YARN.Coupling MEDEA with resource isolation mechanisms, suchas cgroups, can further improve its performance. Unlikesingle-scheduler designs, we show that MEDEA does not im-pact the scheduling latency of task-based applications. Weare currently in the process of contributing MEDEA compo-nents to Apache Hadoop YARN1.

1 https://issues.apache.org/jira/browse/YARN-5468

Page 2: MEDEA: Towards Expressive Scheduling of Long …...Expressive Scheduling of M E EA Long-Running Applications A 0 50 100 150 200 B C D F E 0 50 100 150 200 250 300 YARN YARN-Cgroups

Resource Manager

Task-based Scheduler

LRA Scheduler

1

4

. . .

Heartbeats

3

Container Tag MapTags Containers

Tag 1 Container X Container Y Container N

JobManager

Node Manager

Containers

C1

Cn

6

5

JobManagerJob

ManagerApplicationMaster

Application Constraint Mapapp_001 C= {container, tag-constraint, node-group}

Node Manager

Containers

C1

Cn

Constraint Manager

Container Tags

Node Groups

Placement Constraints

2

Clu

ster

Sta

te

LRAs are increasingly common:• Interactive data-intensive applications, e.g., Spark, Impala, Hive

• Streaming systems, e.g., Storm, Heron, Flink, Millwheel

• Latency-sensitive applications, e.g., HBase, Memcached

• ML frameworks, e.g. Spark ML-Lib and SystemML

Long-running applications (LRAs) = applications with long-running containers, running for hours, days or even months

MOTIVATIONPlace a given LRA in the cluster in a way that:1. Meets the complex LRA requirements 2. Optimizes for future regret3. Does not affect scheduling of traditional task-based apps

GOAL

Panagiotis Garefalakis1,2, Konstantinos Karanasos1, Peter Pietzuch2, Arun Suresh1, Sriram Rao1

1Microsoft 2Imperial College London

Performance benefit of application constraints

Two-scheduler design benefit

The support of the EPSRC Centre for Doctoral Training in High Performance Embedded and Distributed Systems (HiPEDS,Grant Reference EP/L016796/1) is gratefully acknowledged.

Key/value store instances and streaming job example

Expressive Scheduling of Long-Running ApplicationsAEEM

A0

50

100

150

200

B C D F E0

50

100

150

200

250

300YARN YARN-Cgroups MEDEA MEDEA-Cgroups

Req

uest

late

ncy

(ms)

0

10

20

30

40

CL1 CL2 CL3 CL4

Machin

esused

forL

RAs(%)

Machines used for LRAs in four Microsoft clusters

Rack r1

S1KV1

KV2

Rack r2

KV2

KV1

UpgradeDomain u1

UpgradeDomain u2

n1 n2 n5 n6

n3 n4 n7 n8

S1

S1

S1

S1 Collocate KV with S instances (performance)

1. Application ownersImprove LRA performance and resilience

2. Cluster operatorsPlace LRAs in a way that does not hinder placement of future applications (minimize future regret)

3. Scheduling latencyLRAs can tolerate higher scheduling latencies, but short-running containers scheduling should not be affected

Node group Example cluster node sets

node {n1}, {n2}, {n3}, {n4}, {n5}, {n6}, {n7}, {n8}rack {n1, n2, n3, n4}, {n5, n6, n7, n8}upgrade domain {n1, n2, n5, n6}, {n3, n4, n7, n8}

PLACEMENT CONSTRAINTSExpressiveIntra- and inter-application constraintsAffinity/anti-affinity/cardinality constraints

High-levelRefer to current and future LRAsDo not require knowledge of the cluster’s organization

Constraint expression:C = [ container, tag-constraint, node-group ],

where tag-constraint = { tag, cmin, cmax }• Affinity: Caf = [ tID_002, { appID_0023 AND JM, 1, ∞ }, node ]• Anti-affinity: Caa = [ tID_002, { heron, 0, 0 }, upgrade_domain ]• Group cardinality: Cgc = [ *, { IO_critical, 0, 10 }, rack ]

Nodes/node groups Example tags

node n1 memcached, appID_0023, heron, appID_0037rack r1 memcached, appID_0023, appID_0024, heron

A B C D F EYCSB Workload

0102030405060708090

Thro

ughp

ut(K

ops/

s) YARNYARN-CgroupsMEDEAMEDEA-Cgroups

0 200 400 600 800 1000Number of Nodes

101

102

103

104

105

106

107

Sch

edul

ing

runt

ime

(ms

-log

scal

e)

MEDEAPopular Tags

AuroraNode Candidates

0 5 10 20 30 40 50 60 70 80 90 100Percentage of services

0

2

4

6

8

10

12

Sch

edul

ing

late

ncy

(ms) ILP ALL

MEDEA

• Two-scheduler design: 9.5x better latency when LRAs are 20% of workload

• Scalability: comparable latency with greedy approaches (LRAs 20% of cluster)

HBase stressed with YCSB, MR jobs generated with GridMix on a 274 machine cluster

• MEDEA achieves up to 3.9x better tail latency (99th percentile)• MEDEA achieves up to 53% better throughput (35% to YARN+cgroups)

SCHEDULING REQUIREMENTS

Avoid resource & constraintfragmentation (future regret)

Spread containers of same job acrossracks and upgrade domains (resilience)

Avoid node imbalance(future regret)

LRA SCHEDULING• Optimization-based scheduling, formed as an ILP problem• Support for both soft and hard constraints• Objective function: minimize future regret

o Node imbalance, resource & constraint fragmentation

• Re-planning of LRAso Minimize migration cost