SlideShare a Scribd company logo
1 of 70
Download to read offline
Mesos and YARN
Amir H. Payberah
amir@sics.se
Amirkabir University of Technology
(Tehran Polytechnic)
Amir H. Payberah (Tehran Polytechnic) Mesos and YARN 1393/9/15 1 / 49
Motivation
Rapid innovation in cloud computing.
No single framework optimal for all applications.
Amir H. Payberah (Tehran Polytechnic) Mesos and YARN 1393/9/15 2 / 49
Motivation
Rapid innovation in cloud computing.
No single framework optimal for all applications.
Running each framework on its dedicated cluster:
• Expensive
• Hard to share data
Amir H. Payberah (Tehran Polytechnic) Mesos and YARN 1393/9/15 2 / 49
Proposed Solution
Running multiple frameworks on a single cluster
Amir H. Payberah (Tehran Polytechnic) Mesos and YARN 1393/9/15 3 / 49
Proposed Solution
Running multiple frameworks on a single cluster
Maximize utilization
Share data between frameworks
Amir H. Payberah (Tehran Polytechnic) Mesos and YARN 1393/9/15 3 / 49
Two Resource Management Systems ...
Mesos
YARN
Amir H. Payberah (Tehran Polytechnic) Mesos and YARN 1393/9/15 4 / 49
Two Resource Management Systems ...
Mesos
YARN
Amir H. Payberah (Tehran Polytechnic) Mesos and YARN 1393/9/15 4 / 49
Mesos
Mesos
A common resource sharing layer, over which diverse
frameworks can run
Amir H. Payberah (Tehran Polytechnic) Mesos and YARN 1393/9/15 5 / 49
Mesos
Mesos
A common resource sharing layer, over which diverse
frameworks can run
Amir H. Payberah (Tehran Polytechnic) Mesos and YARN 1393/9/15 5 / 49
Mesos Goals
High utilization of resources
Support diverse frameworks (current and future)
Scalability to 10,000’s of nodes
Reliability in face of failures
Amir H. Payberah (Tehran Polytechnic) Mesos and YARN 1393/9/15 6 / 49
Computation Model
A framework (e.g., Hadoop, Spark) manages and runs one or more
jobs.
Amir H. Payberah (Tehran Polytechnic) Mesos and YARN 1393/9/15 7 / 49
Computation Model
A framework (e.g., Hadoop, Spark) manages and runs one or more
jobs.
A job consists of one or more tasks.
Amir H. Payberah (Tehran Polytechnic) Mesos and YARN 1393/9/15 7 / 49
Computation Model
A framework (e.g., Hadoop, Spark) manages and runs one or more
jobs.
A job consists of one or more tasks.
A task (e.g., map, reduce) consists of one or more processes running
on same machine.
Amir H. Payberah (Tehran Polytechnic) Mesos and YARN 1393/9/15 7 / 49
Computation Model
A framework (e.g., Hadoop, Spark) manages and runs one or more
jobs.
A job consists of one or more tasks.
A task (e.g., map, reduce) consists of one or more processes running
on same machine.
Amir H. Payberah (Tehran Polytechnic) Mesos and YARN 1393/9/15 7 / 49
Mesos Design Elements
Fine-grained sharing
Resource offers
Amir H. Payberah (Tehran Polytechnic) Mesos and YARN 1393/9/15 8 / 49
Fine-Grained Sharing
Allocation at the level of tasks within a job.
Improves utilization, latency, and data locality.
Coarse-grained sharing Fine-grained sharing
Amir H. Payberah (Tehran Polytechnic) Mesos and YARN 1393/9/15 9 / 49
Resource Offer
Offer available resources to frameworks, let them pick which re-
sources to use and which tasks to launch.
Keeps Mesos simple, lets it support future frameworks.
Amir H. Payberah (Tehran Polytechnic) Mesos and YARN 1393/9/15 10 / 49
Question?
How to schedule resource offering among frameworks?
Amir H. Payberah (Tehran Polytechnic) Mesos and YARN 1393/9/15 11 / 49
Schedule Frameworks
Global scheduler
Distributed scheduler
Amir H. Payberah (Tehran Polytechnic) Mesos and YARN 1393/9/15 12 / 49
Global Scheduler (1/2)
Job requirements
• Response time
• Throughput
• Availability
Job execution plan
• Task DAG
• Inputs/outputs
Estimates
• Task duration
• Input sizes
• Transfer sizes
Amir H. Payberah (Tehran Polytechnic) Mesos and YARN 1393/9/15 13 / 49
Global Scheduler (2/2)
Advantages
• Can achieve optimal schedule.
Disadvantages
• Complexity: hard to scale and ensure resilience.
• Hard to anticipate future frameworks requirements.
• Need to refactor existing frameworks.
Amir H. Payberah (Tehran Polytechnic) Mesos and YARN 1393/9/15 14 / 49
Distributed Scheduler (1/3)
Amir H. Payberah (Tehran Polytechnic) Mesos and YARN 1393/9/15 15 / 49
Distributed Scheduler (2/3)
Unit of allocation: resource offer
• Vector of available resources on a node
• For example, node1: 1CPU, 1GB , node2: 4CPU, 16GB
Master sends resource offers to frameworks.
Frameworks select which offers to accept and which tasks to run.
Amir H. Payberah (Tehran Polytechnic) Mesos and YARN 1393/9/15 16 / 49
Distributed Scheduler (3/3)
Advantages
• Simple: easier to scale and make resilient.
• Easy to port existing frameworks, support new ones.
Disadvantages
• Distributed scheduling decision: not optimal.
Amir H. Payberah (Tehran Polytechnic) Mesos and YARN 1393/9/15 17 / 49
Mesos Architecture (1/4)
Slaves continuously send status updates about resources to the Master.
Amir H. Payberah (Tehran Polytechnic) Mesos and YARN 1393/9/15 18 / 49
Mesos Architecture (2/4)
Pluggable scheduler picks framework to send an offer to.
Amir H. Payberah (Tehran Polytechnic) Mesos and YARN 1393/9/15 19 / 49
Mesos Architecture (3/4)
Framework scheduler selects resources and provides tasks.
Amir H. Payberah (Tehran Polytechnic) Mesos and YARN 1393/9/15 20 / 49
Mesos Architecture (4/4)
Framework executors launch tasks.
Amir H. Payberah (Tehran Polytechnic) Mesos and YARN 1393/9/15 21 / 49
Question?
How to allocate resources of different types?
Amir H. Payberah (Tehran Polytechnic) Mesos and YARN 1393/9/15 22 / 49
Single Resource: Fair Sharing
n users want to share a resource, e.g., CPU.
• Solution: allocate each 1
n of the shared resource.
CPU
Amir H. Payberah (Tehran Polytechnic) Mesos and YARN 1393/9/15 23 / 49
Single Resource: Fair Sharing
n users want to share a resource, e.g., CPU.
• Solution: allocate each 1
n of the shared resource.
CPU
Generalized by max-min fairness.
• Handles if a user wants less than its fair share.
• E.g., user 1 wants no more than 20%.
Amir H. Payberah (Tehran Polytechnic) Mesos and YARN 1393/9/15 23 / 49
Single Resource: Fair Sharing
n users want to share a resource, e.g., CPU.
• Solution: allocate each 1
n of the shared resource.
CPU
Generalized by max-min fairness.
• Handles if a user wants less than its fair share.
• E.g., user 1 wants no more than 20%.
Generalized by weighted max-min fairness.
• Give weights to users according to importance.
• E.g., user 1 gets weight 1, user 2 weight 2.
Amir H. Payberah (Tehran Polytechnic) Mesos and YARN 1393/9/15 23 / 49
Max-Min Fairness
1 resource: CPU
Total resources: 20 CPU
User 1 has x tasks and wants 1CPU per task
User 2 has y tasks and wants 2CPU per task
Amir H. Payberah (Tehran Polytechnic) Mesos and YARN 1393/9/15 24 / 49
Max-Min Fairness
1 resource: CPU
Total resources: 20 CPU
User 1 has x tasks and wants 1CPU per task
User 2 has y tasks and wants 2CPU per task
max(x, y) (maximize allocation)
Amir H. Payberah (Tehran Polytechnic) Mesos and YARN 1393/9/15 24 / 49
Max-Min Fairness
1 resource: CPU
Total resources: 20 CPU
User 1 has x tasks and wants 1CPU per task
User 2 has y tasks and wants 2CPU per task
max(x, y) (maximize allocation)
subject to
x + 2y ≤ 20 (CPU constraint)
x = 2y
Amir H. Payberah (Tehran Polytechnic) Mesos and YARN 1393/9/15 24 / 49
Max-Min Fairness
1 resource: CPU
Total resources: 20 CPU
User 1 has x tasks and wants 1CPU per task
User 2 has y tasks and wants 2CPU per task
max(x, y) (maximize allocation)
subject to
x + 2y ≤ 20 (CPU constraint)
x = 2y
so
x = 10
y = 5
Amir H. Payberah (Tehran Polytechnic) Mesos and YARN 1393/9/15 24 / 49
Why is Fair Sharing Useful?
Proportional allocation: user 1 gets weight 2, user 2 weight 1.
Priorities: give user 1 weight 1000, user 2 weight 1.
Reservations: ensure user 1 gets 10% of a resource, so give user 1
weight 10, sum weights ≤ 100.
Isolation policy: users cannot affect others beyond their fair share.
Amir H. Payberah (Tehran Polytechnic) Mesos and YARN 1393/9/15 25 / 49
Properties of Max-Min Fairness
Share guarantee
• Each user can get at least 1
n of the resource.
• But will get less if her demand is less.
Strategy proof
• Users are not better off by asking for more than they need.
• Users have no reason to lie.
Amir H. Payberah (Tehran Polytechnic) Mesos and YARN 1393/9/15 26 / 49
Properties of Max-Min Fairness
Share guarantee
• Each user can get at least 1
n of the resource.
• But will get less if her demand is less.
Strategy proof
• Users are not better off by asking for more than they need.
• Users have no reason to lie.
Max-Min fairness is the only reasonable mechanism with these two
properties.
Widely used: OS, networking, datacenters, ...
Amir H. Payberah (Tehran Polytechnic) Mesos and YARN 1393/9/15 26 / 49
Question?
When is Max-Min Fairness NOT Enough?
Amir H. Payberah (Tehran Polytechnic) Mesos and YARN 1393/9/15 27 / 49
Question?
When is Max-Min Fairness NOT Enough?
Need to schedule multiple, heterogeneous resources, e.g.,
CPU, memory, etc.
Amir H. Payberah (Tehran Polytechnic) Mesos and YARN 1393/9/15 27 / 49
Problem
Single resource example
• 1 resource: CPU
• User 1 wants 1CPU per task
• User 2 wants 2CPU per task
Amir H. Payberah (Tehran Polytechnic) Mesos and YARN 1393/9/15 28 / 49
Problem
Single resource example
• 1 resource: CPU
• User 1 wants 1CPU per task
• User 2 wants 2CPU per task
Multi-resource example
• 2 resources: CPUs and mem
• User 1 wants 1CPU, 4GB per task
• User 2 wants 2CPU, 1GB per task
Amir H. Payberah (Tehran Polytechnic) Mesos and YARN 1393/9/15 28 / 49
Problem
Single resource example
• 1 resource: CPU
• User 1 wants 1CPU per task
• User 2 wants 2CPU per task
Multi-resource example
• 2 resources: CPUs and mem
• User 1 wants 1CPU, 4GB per task
• User 2 wants 2CPU, 1GB per task
• What is a fair allocation?
Amir H. Payberah (Tehran Polytechnic) Mesos and YARN 1393/9/15 28 / 49
A Natural Policy (1/2)
Asset fairness: give weights to resources (e.g., 1 CPU = 1 GB) and
equalize total value given to each user.
Amir H. Payberah (Tehran Polytechnic) Mesos and YARN 1393/9/15 29 / 49
A Natural Policy (1/2)
Asset fairness: give weights to resources (e.g., 1 CPU = 1 GB) and
equalize total value given to each user.
Total resources: 28 CPU and 56GB RAM (e.g., 1 CPU = 2 GB)
• User 1 has x tasks and wants 1CPU, 2GB per task
• User 2 has y tasks and wants 1CPU, 4GB per task
Amir H. Payberah (Tehran Polytechnic) Mesos and YARN 1393/9/15 29 / 49
A Natural Policy (1/2)
Asset fairness: give weights to resources (e.g., 1 CPU = 1 GB) and
equalize total value given to each user.
Total resources: 28 CPU and 56GB RAM (e.g., 1 CPU = 2 GB)
• User 1 has x tasks and wants 1CPU, 2GB per task
• User 2 has y tasks and wants 1CPU, 4GB per task
Asset fairness yields:
max(x, y)
x + y ≤ 28
2x + 4y ≤ 56
4x = 6y
User 1: x = 12: 43%CPU, 43%GB ( = 86%)
User 2: y = 8: 28%CPU, 57%GB ( = 86%)
Amir H. Payberah (Tehran Polytechnic) Mesos and YARN 1393/9/15 29 / 49
A Natural Policy (2/2)
Problem: violates share grantee.
User 1 gets less than 50% of both CPU and RAM.
Better off in a separate cluster with half the resources.
Amir H. Payberah (Tehran Polytechnic) Mesos and YARN 1393/9/15 30 / 49
Challenge
Can we find a fair sharing policy that provides:
• Share guarantee
• Strategy-proofness
Can we generalize max-min fairness to multiple resources?
Amir H. Payberah (Tehran Polytechnic) Mesos and YARN 1393/9/15 31 / 49
Proposed Solution
Dominant Resource Fairness (DRF)
Amir H. Payberah (Tehran Polytechnic) Mesos and YARN 1393/9/15 32 / 49
Dominant Resource Fairness (DRF) (1/2)
Dominant resource of a user: the resource that user has the biggest
share of.
• Total resources: 8CPU, 5GB
• User 1 allocation: 2CPU, 1GB
2
8 = 25%CPU and 1
5 = 20%RAM
• Dominant resource of User 1 is CPU (25% > 20%)
Amir H. Payberah (Tehran Polytechnic) Mesos and YARN 1393/9/15 33 / 49
Dominant Resource Fairness (DRF) (1/2)
Dominant resource of a user: the resource that user has the biggest
share of.
• Total resources: 8CPU, 5GB
• User 1 allocation: 2CPU, 1GB
2
8 = 25%CPU and 1
5 = 20%RAM
• Dominant resource of User 1 is CPU (25% > 20%)
Dominant share of a user: the fraction of the dominant resource she
is allocated.
• User 1 dominant share is 25%.
Amir H. Payberah (Tehran Polytechnic) Mesos and YARN 1393/9/15 33 / 49
Dominant Resource Fairness (DRF) (2/2)
Apply max-min fairness to dominant shares: give every user an equal
share of her dominant resource.
Amir H. Payberah (Tehran Polytechnic) Mesos and YARN 1393/9/15 34 / 49
Dominant Resource Fairness (DRF) (2/2)
Apply max-min fairness to dominant shares: give every user an equal
share of her dominant resource.
Equalize the dominant share of the users.
• Total resources: 9CPU, 18GB
• User 1 wants 1CPU, 4GB ; Dominant resource: RAM 1
9 < 4
18
• User 2 wants 3CPU, 1GB ; Dominant resource: CPU 3
9 > 1
18
Amir H. Payberah (Tehran Polytechnic) Mesos and YARN 1393/9/15 34 / 49
Dominant Resource Fairness (DRF) (2/2)
Apply max-min fairness to dominant shares: give every user an equal
share of her dominant resource.
Equalize the dominant share of the users.
• Total resources: 9CPU, 18GB
• User 1 wants 1CPU, 4GB ; Dominant resource: RAM 1
9 < 4
18
• User 2 wants 3CPU, 1GB ; Dominant resource: CPU 3
9 > 1
18
max(x, y)
x + 3y ≤ 9
4x + y ≤ 18
4x
18 = 3y
9
User 1: x = 3: 33%CPU, 66%GB
User 2: y = 2: 66%CPU, 16%GB
Amir H. Payberah (Tehran Polytechnic) Mesos and YARN 1393/9/15 34 / 49
Online DRF Scheduler
Whenever there are available resources and tasks to run:
Schedule a task to the user with the smallest dominant share.
Amir H. Payberah (Tehran Polytechnic) Mesos and YARN 1393/9/15 35 / 49
Two Resource Management Systems ...
Mesos
YARN
Amir H. Payberah (Tehran Polytechnic) Mesos and YARN 1393/9/15 36 / 49
YARN
YARN
Yet Another Resource Negotiator
Amir H. Payberah (Tehran Polytechnic) Mesos and YARN 1393/9/15 37 / 49
YARN Architecture
Resource Manager (RM)
Application Master (AM)
Node Manager (NM)
Amir H. Payberah (Tehran Polytechnic) Mesos and YARN 1393/9/15 38 / 49
YARN Architecture - Resource Manager (1/2)
One per cluster
• Central: global view
• Enable global properties
• Fairness, capacity, locality
Job requests are submitted to RM.
• To start a job (application), RM finds a container to spawn AM.
Container
• Logical bundle of resources (CPU/memory).
No static resource partitioning.
Amir H. Payberah (Tehran Polytechnic) Mesos and YARN 1393/9/15 39 / 49
YARN Architecture - Resource Manager (2/2)
Only handles an overall resource profile for each application.
• Local optimization is up to the application.
Preemption
• Request resources back from an application.
• Checkpoint snapshot instead of explicitly killing jobs / migrate
computation to other containers.
Amir H. Payberah (Tehran Polytechnic) Mesos and YARN 1393/9/15 40 / 49
YARN Architecture - Application Manager (1/2)
The head of a job.
Runs as a container.
Request resources from RM.
• # of containers/resource per container/locality ...
Dynamically changing resource consumption,
based on the containers it receives from the RM.
Amir H. Payberah (Tehran Polytechnic) Mesos and YARN 1393/9/15 41 / 49
YARN Architecture - Application Manager (2/2)
Requests are late-binding.
• The process spawned is not bound to the request, but to the lease.
• The conditions that caused the AM to issue the request may not
remain true when it receives its resources.
Can run any user code, e.g., MapReduce, Spark, etc.
AM determines the semantics of the success or failure of the con-
tainer.
Amir H. Payberah (Tehran Polytechnic) Mesos and YARN 1393/9/15 42 / 49
YARN Architecture - Node Manager (1/2)
The worker daemon.
Registers with RM.
One per node.
Report resources to RM: memory, CPU, ...
Containers are described by a Container Launch Context (CLC).
• The command necessary to create the process
• Environment variables
• Security tokens
• ...
Amir H. Payberah (Tehran Polytechnic) Mesos and YARN 1393/9/15 43 / 49
YARN Architecture - Node Manager (2/2)
Configure the environment for task execution.
Garbage collection.
Auxiliary services.
• A process may produce data that persist beyond the life of the
container.
• Output intermediate data between map and reduce tasks.
Amir H. Payberah (Tehran Polytechnic) Mesos and YARN 1393/9/15 44 / 49
YARN Framework (1/2)
Submitting the application: passing a CLC for the AM to the RM.
When RM starts the AM, it should register with the RM.
• Periodically advertise its liveness and requirements over the
heartbeat protocol.
Amir H. Payberah (Tehran Polytechnic) Mesos and YARN 1393/9/15 45 / 49
YARN Framework (2/2)
Once the RM allocates a container, AM can construct a CLC to
launch the container on the corresponding NM.
• It monitors the status of the running container and stop it when the
resource should be reclaimed.
Once the AM is done with its work, it should unregister from the
RM and exit cleanly.
Amir H. Payberah (Tehran Polytechnic) Mesos and YARN 1393/9/15 46 / 49
Mesos vs. YARN
Similarities:
• Both have schedulers at two levels.
Differences:
• Mesos is an offer-based resource manager, whereas YARN has a
request-based approach.
• Mesos uses framework schedulers for inter-job scheduling, whereas
YARN uses per-job optimization through AM (however, per-job AM
has higher overhead compare to Mesos).
Amir H. Payberah (Tehran Polytechnic) Mesos and YARN 1393/9/15 47 / 49
Summary
Resource management: Mesos and YARN
Mesos
• Offered-based
• Max-Min fairness: DRF
YARN
• Request-based
• RM, AM, NM
Amir H. Payberah (Tehran Polytechnic) Mesos and YARN 1393/9/15 48 / 49
Questions?
Acknowledgements
Some slides were derived from Ion Stoica and Ali Ghodsi slides
(Berkeley University), and Wei-Chiu Chuang slides (Purdue University).
Amir H. Payberah (Tehran Polytechnic) Mesos and YARN 1393/9/15 49 / 49

More Related Content

Viewers also liked

Graph processing - Graphlab
Graph processing - GraphlabGraph processing - Graphlab
Graph processing - GraphlabAmir Payberah
 
Introduction to Operating Systems - Part3
Introduction to Operating Systems - Part3Introduction to Operating Systems - Part3
Introduction to Operating Systems - Part3Amir Payberah
 
Process Management - Part2
Process Management - Part2Process Management - Part2
Process Management - Part2Amir Payberah
 
Introduction to Operating Systems - Part2
Introduction to Operating Systems - Part2Introduction to Operating Systems - Part2
Introduction to Operating Systems - Part2Amir Payberah
 
CPU Scheduling - Part2
CPU Scheduling - Part2CPU Scheduling - Part2
CPU Scheduling - Part2Amir Payberah
 
The Stratosphere Big Data Analytics Platform
The Stratosphere Big Data Analytics PlatformThe Stratosphere Big Data Analytics Platform
The Stratosphere Big Data Analytics PlatformAmir Payberah
 
Process Synchronization - Part2
Process Synchronization -  Part2Process Synchronization -  Part2
Process Synchronization - Part2Amir Payberah
 
Process Synchronization - Part1
Process Synchronization -  Part1Process Synchronization -  Part1
Process Synchronization - Part1Amir Payberah
 
Data Intensive Computing Frameworks
Data Intensive Computing FrameworksData Intensive Computing Frameworks
Data Intensive Computing FrameworksAmir Payberah
 
The Spark Big Data Analytics Platform
The Spark Big Data Analytics PlatformThe Spark Big Data Analytics Platform
The Spark Big Data Analytics PlatformAmir Payberah
 
Introduction to Operating Systems - Part1
Introduction to Operating Systems - Part1Introduction to Operating Systems - Part1
Introduction to Operating Systems - Part1Amir Payberah
 
File System Interface
File System InterfaceFile System Interface
File System InterfaceAmir Payberah
 

Viewers also liked (20)

Graph processing - Graphlab
Graph processing - GraphlabGraph processing - Graphlab
Graph processing - Graphlab
 
Introduction to Operating Systems - Part3
Introduction to Operating Systems - Part3Introduction to Operating Systems - Part3
Introduction to Operating Systems - Part3
 
Threads
ThreadsThreads
Threads
 
Protection
ProtectionProtection
Protection
 
Process Management - Part2
Process Management - Part2Process Management - Part2
Process Management - Part2
 
Introduction to Operating Systems - Part2
Introduction to Operating Systems - Part2Introduction to Operating Systems - Part2
Introduction to Operating Systems - Part2
 
Cloud Computing
Cloud ComputingCloud Computing
Cloud Computing
 
IO Systems
IO SystemsIO Systems
IO Systems
 
Security
SecuritySecurity
Security
 
Main Memory - Part2
Main Memory - Part2Main Memory - Part2
Main Memory - Part2
 
CPU Scheduling - Part2
CPU Scheduling - Part2CPU Scheduling - Part2
CPU Scheduling - Part2
 
Storage
StorageStorage
Storage
 
The Stratosphere Big Data Analytics Platform
The Stratosphere Big Data Analytics PlatformThe Stratosphere Big Data Analytics Platform
The Stratosphere Big Data Analytics Platform
 
Process Synchronization - Part2
Process Synchronization -  Part2Process Synchronization -  Part2
Process Synchronization - Part2
 
Process Synchronization - Part1
Process Synchronization -  Part1Process Synchronization -  Part1
Process Synchronization - Part1
 
Data Intensive Computing Frameworks
Data Intensive Computing FrameworksData Intensive Computing Frameworks
Data Intensive Computing Frameworks
 
The Spark Big Data Analytics Platform
The Spark Big Data Analytics PlatformThe Spark Big Data Analytics Platform
The Spark Big Data Analytics Platform
 
Deadlocks
DeadlocksDeadlocks
Deadlocks
 
Introduction to Operating Systems - Part1
Introduction to Operating Systems - Part1Introduction to Operating Systems - Part1
Introduction to Operating Systems - Part1
 
File System Interface
File System InterfaceFile System Interface
File System Interface
 

Similar to Mesos and YARN

Virtual Memory - Part2
Virtual Memory - Part2Virtual Memory - Part2
Virtual Memory - Part2Amir Payberah
 
Hadoop Summit San Jose 2015: Towards SLA-based Scheduling on YARN Clusters
Hadoop Summit San Jose 2015: Towards SLA-based Scheduling on YARN Clusters Hadoop Summit San Jose 2015: Towards SLA-based Scheduling on YARN Clusters
Hadoop Summit San Jose 2015: Towards SLA-based Scheduling on YARN Clusters Sumeet Singh
 
Cloud Computing
Cloud ComputingCloud Computing
Cloud Computingbutest
 
Cloud Computing
Cloud ComputingCloud Computing
Cloud Computingbutest
 
Towards SLA-based Scheduling on YARN Clusters
Towards SLA-based Scheduling on YARN ClustersTowards SLA-based Scheduling on YARN Clusters
Towards SLA-based Scheduling on YARN ClustersDataWorks Summit
 
Introduction to cloud computing and big data - part1
Introduction to cloud computing and big data - part1Introduction to cloud computing and big data - part1
Introduction to cloud computing and big data - part1Amir Payberah
 
Time, clocks and the ordering of events
Time, clocks and the ordering of eventsTime, clocks and the ordering of events
Time, clocks and the ordering of eventsAmir Payberah
 
Dominant resource fairness fair allocation of multiple resource types
Dominant resource fairness fair allocation of multiple resource typesDominant resource fairness fair allocation of multiple resource types
Dominant resource fairness fair allocation of multiple resource typesanet18
 
Virtual Memory - Part1
Virtual Memory - Part1Virtual Memory - Part1
Virtual Memory - Part1Amir Payberah
 
File System Implementation - Part2
File System Implementation - Part2File System Implementation - Part2
File System Implementation - Part2Amir Payberah
 
Hadoop Summit - Scheduling policies in YARN - San Jose 2016
Hadoop Summit - Scheduling policies in YARN - San Jose 2016Hadoop Summit - Scheduling policies in YARN - San Jose 2016
Hadoop Summit - Scheduling policies in YARN - San Jose 2016Wangda Tan
 
Computer Architecture Formulas1. CPU time = Instru.docx
Computer Architecture Formulas1. CPU time = Instru.docxComputer Architecture Formulas1. CPU time = Instru.docx
Computer Architecture Formulas1. CPU time = Instru.docxzollyjenkins
 

Similar to Mesos and YARN (20)

Virtual Memory - Part2
Virtual Memory - Part2Virtual Memory - Part2
Virtual Memory - Part2
 
Bigtable
BigtableBigtable
Bigtable
 
Chubby
ChubbyChubby
Chubby
 
Hadoop Summit San Jose 2015: Towards SLA-based Scheduling on YARN Clusters
Hadoop Summit San Jose 2015: Towards SLA-based Scheduling on YARN Clusters Hadoop Summit San Jose 2015: Towards SLA-based Scheduling on YARN Clusters
Hadoop Summit San Jose 2015: Towards SLA-based Scheduling on YARN Clusters
 
Cloud Computing
Cloud ComputingCloud Computing
Cloud Computing
 
Cloud Computing
Cloud ComputingCloud Computing
Cloud Computing
 
Towards SLA-based Scheduling on YARN Clusters
Towards SLA-based Scheduling on YARN ClustersTowards SLA-based Scheduling on YARN Clusters
Towards SLA-based Scheduling on YARN Clusters
 
Introduction to cloud computing and big data - part1
Introduction to cloud computing and big data - part1Introduction to cloud computing and big data - part1
Introduction to cloud computing and big data - part1
 
Time, clocks and the ordering of events
Time, clocks and the ordering of eventsTime, clocks and the ordering of events
Time, clocks and the ordering of events
 
Spark
SparkSpark
Spark
 
Google File System
Google File SystemGoogle File System
Google File System
 
Main Memory - Part1
Main Memory - Part1Main Memory - Part1
Main Memory - Part1
 
Dominant resource fairness fair allocation of multiple resource types
Dominant resource fairness fair allocation of multiple resource typesDominant resource fairness fair allocation of multiple resource types
Dominant resource fairness fair allocation of multiple resource types
 
Virtual Memory - Part1
Virtual Memory - Part1Virtual Memory - Part1
Virtual Memory - Part1
 
File System Implementation - Part2
File System Implementation - Part2File System Implementation - Part2
File System Implementation - Part2
 
Scheduling Policies in YARN
Scheduling Policies in YARNScheduling Policies in YARN
Scheduling Policies in YARN
 
Hadoop Summit - Scheduling policies in YARN - San Jose 2016
Hadoop Summit - Scheduling policies in YARN - San Jose 2016Hadoop Summit - Scheduling policies in YARN - San Jose 2016
Hadoop Summit - Scheduling policies in YARN - San Jose 2016
 
Computer Architecture Formulas1. CPU time = Instru.docx
Computer Architecture Formulas1. CPU time = Instru.docxComputer Architecture Formulas1. CPU time = Instru.docx
Computer Architecture Formulas1. CPU time = Instru.docx
 
CS4961-L1.ppt
CS4961-L1.pptCS4961-L1.ppt
CS4961-L1.ppt
 
High–Performance Computing
High–Performance ComputingHigh–Performance Computing
High–Performance Computing
 

Recently uploaded

TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsMaria Levchenko
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxMalak Abu Hammad
 
Top 5 Benefits OF Using Muvi Live Paywall For Live Streams
Top 5 Benefits OF Using Muvi Live Paywall For Live StreamsTop 5 Benefits OF Using Muvi Live Paywall For Live Streams
Top 5 Benefits OF Using Muvi Live Paywall For Live StreamsRoshan Dwivedi
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processorsdebabhi2
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationMichael W. Hawkins
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityPrincipled Technologies
 
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEarley Information Science
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘RTylerCroy
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreternaman860154
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking MenDelhi Call girls
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)Gabriella Davis
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerThousandEyes
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024The Digital Insurer
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...apidays
 
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...gurkirankumar98700
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024The Digital Insurer
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking MenDelhi Call girls
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountPuma Security, LLC
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Servicegiselly40
 

Recently uploaded (20)

TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed texts
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptx
 
Top 5 Benefits OF Using Muvi Live Paywall For Live Streams
Top 5 Benefits OF Using Muvi Live Paywall For Live StreamsTop 5 Benefits OF Using Muvi Live Paywall For Live Streams
Top 5 Benefits OF Using Muvi Live Paywall For Live Streams
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day Presentation
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivity
 
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreter
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
 
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path Mount
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Service
 

Mesos and YARN

  • 1. Mesos and YARN Amir H. Payberah amir@sics.se Amirkabir University of Technology (Tehran Polytechnic) Amir H. Payberah (Tehran Polytechnic) Mesos and YARN 1393/9/15 1 / 49
  • 2. Motivation Rapid innovation in cloud computing. No single framework optimal for all applications. Amir H. Payberah (Tehran Polytechnic) Mesos and YARN 1393/9/15 2 / 49
  • 3. Motivation Rapid innovation in cloud computing. No single framework optimal for all applications. Running each framework on its dedicated cluster: • Expensive • Hard to share data Amir H. Payberah (Tehran Polytechnic) Mesos and YARN 1393/9/15 2 / 49
  • 4. Proposed Solution Running multiple frameworks on a single cluster Amir H. Payberah (Tehran Polytechnic) Mesos and YARN 1393/9/15 3 / 49
  • 5. Proposed Solution Running multiple frameworks on a single cluster Maximize utilization Share data between frameworks Amir H. Payberah (Tehran Polytechnic) Mesos and YARN 1393/9/15 3 / 49
  • 6. Two Resource Management Systems ... Mesos YARN Amir H. Payberah (Tehran Polytechnic) Mesos and YARN 1393/9/15 4 / 49
  • 7. Two Resource Management Systems ... Mesos YARN Amir H. Payberah (Tehran Polytechnic) Mesos and YARN 1393/9/15 4 / 49
  • 8. Mesos Mesos A common resource sharing layer, over which diverse frameworks can run Amir H. Payberah (Tehran Polytechnic) Mesos and YARN 1393/9/15 5 / 49
  • 9. Mesos Mesos A common resource sharing layer, over which diverse frameworks can run Amir H. Payberah (Tehran Polytechnic) Mesos and YARN 1393/9/15 5 / 49
  • 10. Mesos Goals High utilization of resources Support diverse frameworks (current and future) Scalability to 10,000’s of nodes Reliability in face of failures Amir H. Payberah (Tehran Polytechnic) Mesos and YARN 1393/9/15 6 / 49
  • 11. Computation Model A framework (e.g., Hadoop, Spark) manages and runs one or more jobs. Amir H. Payberah (Tehran Polytechnic) Mesos and YARN 1393/9/15 7 / 49
  • 12. Computation Model A framework (e.g., Hadoop, Spark) manages and runs one or more jobs. A job consists of one or more tasks. Amir H. Payberah (Tehran Polytechnic) Mesos and YARN 1393/9/15 7 / 49
  • 13. Computation Model A framework (e.g., Hadoop, Spark) manages and runs one or more jobs. A job consists of one or more tasks. A task (e.g., map, reduce) consists of one or more processes running on same machine. Amir H. Payberah (Tehran Polytechnic) Mesos and YARN 1393/9/15 7 / 49
  • 14. Computation Model A framework (e.g., Hadoop, Spark) manages and runs one or more jobs. A job consists of one or more tasks. A task (e.g., map, reduce) consists of one or more processes running on same machine. Amir H. Payberah (Tehran Polytechnic) Mesos and YARN 1393/9/15 7 / 49
  • 15. Mesos Design Elements Fine-grained sharing Resource offers Amir H. Payberah (Tehran Polytechnic) Mesos and YARN 1393/9/15 8 / 49
  • 16. Fine-Grained Sharing Allocation at the level of tasks within a job. Improves utilization, latency, and data locality. Coarse-grained sharing Fine-grained sharing Amir H. Payberah (Tehran Polytechnic) Mesos and YARN 1393/9/15 9 / 49
  • 17. Resource Offer Offer available resources to frameworks, let them pick which re- sources to use and which tasks to launch. Keeps Mesos simple, lets it support future frameworks. Amir H. Payberah (Tehran Polytechnic) Mesos and YARN 1393/9/15 10 / 49
  • 18. Question? How to schedule resource offering among frameworks? Amir H. Payberah (Tehran Polytechnic) Mesos and YARN 1393/9/15 11 / 49
  • 19. Schedule Frameworks Global scheduler Distributed scheduler Amir H. Payberah (Tehran Polytechnic) Mesos and YARN 1393/9/15 12 / 49
  • 20. Global Scheduler (1/2) Job requirements • Response time • Throughput • Availability Job execution plan • Task DAG • Inputs/outputs Estimates • Task duration • Input sizes • Transfer sizes Amir H. Payberah (Tehran Polytechnic) Mesos and YARN 1393/9/15 13 / 49
  • 21. Global Scheduler (2/2) Advantages • Can achieve optimal schedule. Disadvantages • Complexity: hard to scale and ensure resilience. • Hard to anticipate future frameworks requirements. • Need to refactor existing frameworks. Amir H. Payberah (Tehran Polytechnic) Mesos and YARN 1393/9/15 14 / 49
  • 22. Distributed Scheduler (1/3) Amir H. Payberah (Tehran Polytechnic) Mesos and YARN 1393/9/15 15 / 49
  • 23. Distributed Scheduler (2/3) Unit of allocation: resource offer • Vector of available resources on a node • For example, node1: 1CPU, 1GB , node2: 4CPU, 16GB Master sends resource offers to frameworks. Frameworks select which offers to accept and which tasks to run. Amir H. Payberah (Tehran Polytechnic) Mesos and YARN 1393/9/15 16 / 49
  • 24. Distributed Scheduler (3/3) Advantages • Simple: easier to scale and make resilient. • Easy to port existing frameworks, support new ones. Disadvantages • Distributed scheduling decision: not optimal. Amir H. Payberah (Tehran Polytechnic) Mesos and YARN 1393/9/15 17 / 49
  • 25. Mesos Architecture (1/4) Slaves continuously send status updates about resources to the Master. Amir H. Payberah (Tehran Polytechnic) Mesos and YARN 1393/9/15 18 / 49
  • 26. Mesos Architecture (2/4) Pluggable scheduler picks framework to send an offer to. Amir H. Payberah (Tehran Polytechnic) Mesos and YARN 1393/9/15 19 / 49
  • 27. Mesos Architecture (3/4) Framework scheduler selects resources and provides tasks. Amir H. Payberah (Tehran Polytechnic) Mesos and YARN 1393/9/15 20 / 49
  • 28. Mesos Architecture (4/4) Framework executors launch tasks. Amir H. Payberah (Tehran Polytechnic) Mesos and YARN 1393/9/15 21 / 49
  • 29. Question? How to allocate resources of different types? Amir H. Payberah (Tehran Polytechnic) Mesos and YARN 1393/9/15 22 / 49
  • 30. Single Resource: Fair Sharing n users want to share a resource, e.g., CPU. • Solution: allocate each 1 n of the shared resource. CPU Amir H. Payberah (Tehran Polytechnic) Mesos and YARN 1393/9/15 23 / 49
  • 31. Single Resource: Fair Sharing n users want to share a resource, e.g., CPU. • Solution: allocate each 1 n of the shared resource. CPU Generalized by max-min fairness. • Handles if a user wants less than its fair share. • E.g., user 1 wants no more than 20%. Amir H. Payberah (Tehran Polytechnic) Mesos and YARN 1393/9/15 23 / 49
  • 32. Single Resource: Fair Sharing n users want to share a resource, e.g., CPU. • Solution: allocate each 1 n of the shared resource. CPU Generalized by max-min fairness. • Handles if a user wants less than its fair share. • E.g., user 1 wants no more than 20%. Generalized by weighted max-min fairness. • Give weights to users according to importance. • E.g., user 1 gets weight 1, user 2 weight 2. Amir H. Payberah (Tehran Polytechnic) Mesos and YARN 1393/9/15 23 / 49
  • 33. Max-Min Fairness 1 resource: CPU Total resources: 20 CPU User 1 has x tasks and wants 1CPU per task User 2 has y tasks and wants 2CPU per task Amir H. Payberah (Tehran Polytechnic) Mesos and YARN 1393/9/15 24 / 49
  • 34. Max-Min Fairness 1 resource: CPU Total resources: 20 CPU User 1 has x tasks and wants 1CPU per task User 2 has y tasks and wants 2CPU per task max(x, y) (maximize allocation) Amir H. Payberah (Tehran Polytechnic) Mesos and YARN 1393/9/15 24 / 49
  • 35. Max-Min Fairness 1 resource: CPU Total resources: 20 CPU User 1 has x tasks and wants 1CPU per task User 2 has y tasks and wants 2CPU per task max(x, y) (maximize allocation) subject to x + 2y ≤ 20 (CPU constraint) x = 2y Amir H. Payberah (Tehran Polytechnic) Mesos and YARN 1393/9/15 24 / 49
  • 36. Max-Min Fairness 1 resource: CPU Total resources: 20 CPU User 1 has x tasks and wants 1CPU per task User 2 has y tasks and wants 2CPU per task max(x, y) (maximize allocation) subject to x + 2y ≤ 20 (CPU constraint) x = 2y so x = 10 y = 5 Amir H. Payberah (Tehran Polytechnic) Mesos and YARN 1393/9/15 24 / 49
  • 37. Why is Fair Sharing Useful? Proportional allocation: user 1 gets weight 2, user 2 weight 1. Priorities: give user 1 weight 1000, user 2 weight 1. Reservations: ensure user 1 gets 10% of a resource, so give user 1 weight 10, sum weights ≤ 100. Isolation policy: users cannot affect others beyond their fair share. Amir H. Payberah (Tehran Polytechnic) Mesos and YARN 1393/9/15 25 / 49
  • 38. Properties of Max-Min Fairness Share guarantee • Each user can get at least 1 n of the resource. • But will get less if her demand is less. Strategy proof • Users are not better off by asking for more than they need. • Users have no reason to lie. Amir H. Payberah (Tehran Polytechnic) Mesos and YARN 1393/9/15 26 / 49
  • 39. Properties of Max-Min Fairness Share guarantee • Each user can get at least 1 n of the resource. • But will get less if her demand is less. Strategy proof • Users are not better off by asking for more than they need. • Users have no reason to lie. Max-Min fairness is the only reasonable mechanism with these two properties. Widely used: OS, networking, datacenters, ... Amir H. Payberah (Tehran Polytechnic) Mesos and YARN 1393/9/15 26 / 49
  • 40. Question? When is Max-Min Fairness NOT Enough? Amir H. Payberah (Tehran Polytechnic) Mesos and YARN 1393/9/15 27 / 49
  • 41. Question? When is Max-Min Fairness NOT Enough? Need to schedule multiple, heterogeneous resources, e.g., CPU, memory, etc. Amir H. Payberah (Tehran Polytechnic) Mesos and YARN 1393/9/15 27 / 49
  • 42. Problem Single resource example • 1 resource: CPU • User 1 wants 1CPU per task • User 2 wants 2CPU per task Amir H. Payberah (Tehran Polytechnic) Mesos and YARN 1393/9/15 28 / 49
  • 43. Problem Single resource example • 1 resource: CPU • User 1 wants 1CPU per task • User 2 wants 2CPU per task Multi-resource example • 2 resources: CPUs and mem • User 1 wants 1CPU, 4GB per task • User 2 wants 2CPU, 1GB per task Amir H. Payberah (Tehran Polytechnic) Mesos and YARN 1393/9/15 28 / 49
  • 44. Problem Single resource example • 1 resource: CPU • User 1 wants 1CPU per task • User 2 wants 2CPU per task Multi-resource example • 2 resources: CPUs and mem • User 1 wants 1CPU, 4GB per task • User 2 wants 2CPU, 1GB per task • What is a fair allocation? Amir H. Payberah (Tehran Polytechnic) Mesos and YARN 1393/9/15 28 / 49
  • 45. A Natural Policy (1/2) Asset fairness: give weights to resources (e.g., 1 CPU = 1 GB) and equalize total value given to each user. Amir H. Payberah (Tehran Polytechnic) Mesos and YARN 1393/9/15 29 / 49
  • 46. A Natural Policy (1/2) Asset fairness: give weights to resources (e.g., 1 CPU = 1 GB) and equalize total value given to each user. Total resources: 28 CPU and 56GB RAM (e.g., 1 CPU = 2 GB) • User 1 has x tasks and wants 1CPU, 2GB per task • User 2 has y tasks and wants 1CPU, 4GB per task Amir H. Payberah (Tehran Polytechnic) Mesos and YARN 1393/9/15 29 / 49
  • 47. A Natural Policy (1/2) Asset fairness: give weights to resources (e.g., 1 CPU = 1 GB) and equalize total value given to each user. Total resources: 28 CPU and 56GB RAM (e.g., 1 CPU = 2 GB) • User 1 has x tasks and wants 1CPU, 2GB per task • User 2 has y tasks and wants 1CPU, 4GB per task Asset fairness yields: max(x, y) x + y ≤ 28 2x + 4y ≤ 56 4x = 6y User 1: x = 12: 43%CPU, 43%GB ( = 86%) User 2: y = 8: 28%CPU, 57%GB ( = 86%) Amir H. Payberah (Tehran Polytechnic) Mesos and YARN 1393/9/15 29 / 49
  • 48. A Natural Policy (2/2) Problem: violates share grantee. User 1 gets less than 50% of both CPU and RAM. Better off in a separate cluster with half the resources. Amir H. Payberah (Tehran Polytechnic) Mesos and YARN 1393/9/15 30 / 49
  • 49. Challenge Can we find a fair sharing policy that provides: • Share guarantee • Strategy-proofness Can we generalize max-min fairness to multiple resources? Amir H. Payberah (Tehran Polytechnic) Mesos and YARN 1393/9/15 31 / 49
  • 50. Proposed Solution Dominant Resource Fairness (DRF) Amir H. Payberah (Tehran Polytechnic) Mesos and YARN 1393/9/15 32 / 49
  • 51. Dominant Resource Fairness (DRF) (1/2) Dominant resource of a user: the resource that user has the biggest share of. • Total resources: 8CPU, 5GB • User 1 allocation: 2CPU, 1GB 2 8 = 25%CPU and 1 5 = 20%RAM • Dominant resource of User 1 is CPU (25% > 20%) Amir H. Payberah (Tehran Polytechnic) Mesos and YARN 1393/9/15 33 / 49
  • 52. Dominant Resource Fairness (DRF) (1/2) Dominant resource of a user: the resource that user has the biggest share of. • Total resources: 8CPU, 5GB • User 1 allocation: 2CPU, 1GB 2 8 = 25%CPU and 1 5 = 20%RAM • Dominant resource of User 1 is CPU (25% > 20%) Dominant share of a user: the fraction of the dominant resource she is allocated. • User 1 dominant share is 25%. Amir H. Payberah (Tehran Polytechnic) Mesos and YARN 1393/9/15 33 / 49
  • 53. Dominant Resource Fairness (DRF) (2/2) Apply max-min fairness to dominant shares: give every user an equal share of her dominant resource. Amir H. Payberah (Tehran Polytechnic) Mesos and YARN 1393/9/15 34 / 49
  • 54. Dominant Resource Fairness (DRF) (2/2) Apply max-min fairness to dominant shares: give every user an equal share of her dominant resource. Equalize the dominant share of the users. • Total resources: 9CPU, 18GB • User 1 wants 1CPU, 4GB ; Dominant resource: RAM 1 9 < 4 18 • User 2 wants 3CPU, 1GB ; Dominant resource: CPU 3 9 > 1 18 Amir H. Payberah (Tehran Polytechnic) Mesos and YARN 1393/9/15 34 / 49
  • 55. Dominant Resource Fairness (DRF) (2/2) Apply max-min fairness to dominant shares: give every user an equal share of her dominant resource. Equalize the dominant share of the users. • Total resources: 9CPU, 18GB • User 1 wants 1CPU, 4GB ; Dominant resource: RAM 1 9 < 4 18 • User 2 wants 3CPU, 1GB ; Dominant resource: CPU 3 9 > 1 18 max(x, y) x + 3y ≤ 9 4x + y ≤ 18 4x 18 = 3y 9 User 1: x = 3: 33%CPU, 66%GB User 2: y = 2: 66%CPU, 16%GB Amir H. Payberah (Tehran Polytechnic) Mesos and YARN 1393/9/15 34 / 49
  • 56. Online DRF Scheduler Whenever there are available resources and tasks to run: Schedule a task to the user with the smallest dominant share. Amir H. Payberah (Tehran Polytechnic) Mesos and YARN 1393/9/15 35 / 49
  • 57. Two Resource Management Systems ... Mesos YARN Amir H. Payberah (Tehran Polytechnic) Mesos and YARN 1393/9/15 36 / 49
  • 58. YARN YARN Yet Another Resource Negotiator Amir H. Payberah (Tehran Polytechnic) Mesos and YARN 1393/9/15 37 / 49
  • 59. YARN Architecture Resource Manager (RM) Application Master (AM) Node Manager (NM) Amir H. Payberah (Tehran Polytechnic) Mesos and YARN 1393/9/15 38 / 49
  • 60. YARN Architecture - Resource Manager (1/2) One per cluster • Central: global view • Enable global properties • Fairness, capacity, locality Job requests are submitted to RM. • To start a job (application), RM finds a container to spawn AM. Container • Logical bundle of resources (CPU/memory). No static resource partitioning. Amir H. Payberah (Tehran Polytechnic) Mesos and YARN 1393/9/15 39 / 49
  • 61. YARN Architecture - Resource Manager (2/2) Only handles an overall resource profile for each application. • Local optimization is up to the application. Preemption • Request resources back from an application. • Checkpoint snapshot instead of explicitly killing jobs / migrate computation to other containers. Amir H. Payberah (Tehran Polytechnic) Mesos and YARN 1393/9/15 40 / 49
  • 62. YARN Architecture - Application Manager (1/2) The head of a job. Runs as a container. Request resources from RM. • # of containers/resource per container/locality ... Dynamically changing resource consumption, based on the containers it receives from the RM. Amir H. Payberah (Tehran Polytechnic) Mesos and YARN 1393/9/15 41 / 49
  • 63. YARN Architecture - Application Manager (2/2) Requests are late-binding. • The process spawned is not bound to the request, but to the lease. • The conditions that caused the AM to issue the request may not remain true when it receives its resources. Can run any user code, e.g., MapReduce, Spark, etc. AM determines the semantics of the success or failure of the con- tainer. Amir H. Payberah (Tehran Polytechnic) Mesos and YARN 1393/9/15 42 / 49
  • 64. YARN Architecture - Node Manager (1/2) The worker daemon. Registers with RM. One per node. Report resources to RM: memory, CPU, ... Containers are described by a Container Launch Context (CLC). • The command necessary to create the process • Environment variables • Security tokens • ... Amir H. Payberah (Tehran Polytechnic) Mesos and YARN 1393/9/15 43 / 49
  • 65. YARN Architecture - Node Manager (2/2) Configure the environment for task execution. Garbage collection. Auxiliary services. • A process may produce data that persist beyond the life of the container. • Output intermediate data between map and reduce tasks. Amir H. Payberah (Tehran Polytechnic) Mesos and YARN 1393/9/15 44 / 49
  • 66. YARN Framework (1/2) Submitting the application: passing a CLC for the AM to the RM. When RM starts the AM, it should register with the RM. • Periodically advertise its liveness and requirements over the heartbeat protocol. Amir H. Payberah (Tehran Polytechnic) Mesos and YARN 1393/9/15 45 / 49
  • 67. YARN Framework (2/2) Once the RM allocates a container, AM can construct a CLC to launch the container on the corresponding NM. • It monitors the status of the running container and stop it when the resource should be reclaimed. Once the AM is done with its work, it should unregister from the RM and exit cleanly. Amir H. Payberah (Tehran Polytechnic) Mesos and YARN 1393/9/15 46 / 49
  • 68. Mesos vs. YARN Similarities: • Both have schedulers at two levels. Differences: • Mesos is an offer-based resource manager, whereas YARN has a request-based approach. • Mesos uses framework schedulers for inter-job scheduling, whereas YARN uses per-job optimization through AM (however, per-job AM has higher overhead compare to Mesos). Amir H. Payberah (Tehran Polytechnic) Mesos and YARN 1393/9/15 47 / 49
  • 69. Summary Resource management: Mesos and YARN Mesos • Offered-based • Max-Min fairness: DRF YARN • Request-based • RM, AM, NM Amir H. Payberah (Tehran Polytechnic) Mesos and YARN 1393/9/15 48 / 49
  • 70. Questions? Acknowledgements Some slides were derived from Ion Stoica and Ali Ghodsi slides (Berkeley University), and Wei-Chiu Chuang slides (Purdue University). Amir H. Payberah (Tehran Polytechnic) Mesos and YARN 1393/9/15 49 / 49