Friendly Virtual Machines Motivation: Trend #1cs-pub.bu.edu/faculty/best/research/talks/FVM.pdf ·...

7
1 http://www.cs.bu.edu/groups/wing Friendly Virtual Machines Leveraging a Feedback-Control Model for Application Adaptation Azer Bestavros Joint work with Yuting Zhang, Mina Guirguis, Ibrahim Matta, and Richard West First ACM/USENIX Conference on Virtual Execution Environments (VEE'05) June 11 th , 2005 06/11/2005 FVM @ VEE'05 2 Motivation: Trend #1 Emergence/acceptance of VM abstraction OTS VMware, UML, IBM Virtual Hosting solutions (circa ’05) Used mostly in closed, managed environments [Graphics from http://www.vmware.com/] 06/11/2005 FVM @ VEE'05 3 Motivation: Trend #2 Apps running on shared 3 rd party hosts PlanetLab and Emulab experimental testbeds IBM, Akamai, Speedera edge-computing & hosting services [Graphics from http://www.speedera.com & http://www.ibm.com] 06/11/2005 FVM @ VEE'05 4 Motivation: Trend #3 Need to isolate independent constituents Virtual web hosting; e.g., Mozilla Application VM (circa ’01) Shared infrastructures; e.g., Grids, Sensoria, overlays PlanetLab’s use of VMs for various services on a single host [Graphics from http://www.planet-lab.org/] 06/11/2005 FVM @ VEE'05 5 Shared Host Resources: Issues Infrastructure Hosting Environment App App App App Infrastructure Hosting Environment App App App App Under-provisioned Host Overload Inefficient use of host resources Unpredictability due to OS thrash mitigation measures Unfair/uninformed allocation of resources to applications 06/11/2005 FVM @ VEE'05 6 Resource Allocation: How? Three Schools of Thought OS or VMM micromanages access to resources Adds complexity to common infrastructure Agnostic to application adaptation Special APIs not suitable for open systems Reservation based allocation Inefficient, especially with highly dynamic applications Incompatible with inherently “best-effort” resources Hosting infrastructure must police applications Best-effort allocation with overload protection Simple common infrastructure Applications must adapt to resource allocation No notion of fairness among disparate apps

Transcript of Friendly Virtual Machines Motivation: Trend #1cs-pub.bu.edu/faculty/best/research/talks/FVM.pdf ·...

Page 1: Friendly Virtual Machines Motivation: Trend #1cs-pub.bu.edu/faculty/best/research/talks/FVM.pdf · Yuting Zhang, Mina Guirguis, Ibrahim Matta, and Richard West First ACM/USENIX Conference

1

http://www.cs.bu.edu/groups/wing

Friendly Virtual MachinesLeveraging a Feedback-Control Model for Application Adaptation

Azer Bestavros

Joint work withYuting Zhang, Mina Guirguis, Ibrahim Matta, and Richard West

First ACM/USENIX Conference on Virtual Execution Environments (VEE'05)

June 11th, 200506/11/2005 FVM @ VEE'05 2

Motivation: Trend #1

Emergence/acceptance of VM abstractionOTS VMware, UML, IBM Virtual Hosting solutions (circa ’05)Used mostly in closed, managed environments

[Graphics from http://www.vmware.com/]

06/11/2005 FVM @ VEE'05 3

Motivation: Trend #2

Apps running on shared 3rd party hostsPlanetLab and Emulab experimental testbedsIBM, Akamai, Speedera edge-computing & hosting services

[Graphics from http://www.speedera.com & http://www.ibm.com]

06/11/2005 FVM @ VEE'05 4

Motivation: Trend #3

Need to isolate independent constituentsVirtual web hosting; e.g., Mozilla Application VM (circa ’01)Shared infrastructures; e.g., Grids, Sensoria, overlaysPlanetLab’s use of VMs for various services on a single host

[Graphics from http://www.planet-lab.org/]

06/11/2005 FVM @ VEE'05 5

Shared Host Resources: Issues

Infrastructure

Hosting Environment

App App App App

Infrastructure

Hosting Environment

App App App App

Under-provisioned Host OverloadInefficient use of host resourcesUnpredictability due to OS thrash mitigation measures Unfair/uninformed allocation of resources to applications

06/11/2005 FVM @ VEE'05 6

Resource Allocation: How?

Three Schools of ThoughtOS or VMM micromanages access to resources

Adds complexity to common infrastructureAgnostic to application adaptation Special APIs not suitable for open systems

Reservation based allocationInefficient, especially with highly dynamic applications Incompatible with inherently “best-effort” resourcesHosting infrastructure must police applications

Best-effort allocation with overload protectionSimple common infrastructureApplications must adapt to resource allocationNo notion of fairness among disparate apps

Page 2: Friendly Virtual Machines Motivation: Trend #1cs-pub.bu.edu/faculty/best/research/talks/FVM.pdf · Yuting Zhang, Mina Guirguis, Ibrahim Matta, and Richard West First ACM/USENIX Conference

2

06/11/2005 FVM @ VEE'05 7

Resource Allocation: Wish List

Simple hosting infrastructureMacro, not micro-management; OK to monitor, police, …

Application autonomyNo explicit coordination between applications or with host

Performance isolationApplications with different bottlenecks need not tussle

Convergence to fairnessSystem should converge to a fair allocation of resources

Efficient resource utilizationNo overload; no underutilization

06/11/2005 FVM @ VEE'05 8

Our Solution: E2E-style

Minimal Host FunctionalityBest-effort, round-robin-style resource allocationProvide “congestion” feedback signal to appsImplement policing of non-compliant apps

Adaptive Resource Consumption by AppsProbe available resources and react to congestionAdaptation mechanisms may vary to suit apps Compliance, or friendliness is well defined

06/11/2005 FVM @ VEE'05 9

An Instance of Host Sharing

VMs as applicationsVMs used to provide isolation, namely safety and securityHosts are powerful enough to support many VMsVMs compete for host resources and may exhibit radically different resource needs (e.g., memory-bound, CPU-bound, I/O-bound, net-bound, …)

06/11/2005 FVM @ VEE'05 10

Our E2E Solution: Friendly VMs

VMs adapt their resource consumption ratebased on congestion feedback signal

Benefits:Minimal resource management in host OS/VMMFriendly (efficient and fair) sharing of system resources among VMsTransparent to the application on top as well as the OS hosting the VMs below

06/11/2005 FVM @ VEE'05 11

Our E2E Solution: Friendly VMs

VMs adapt their resource consumption ratebased on congestion feedback signal

Elements of the solution:What constitutes the feedback signal?How to control consumption rate?What adaptation strategy is appropriate?

06/11/2005 FVM @ VEE'05 12

FVM: Feedback Signal

Virtual Clock Time (VCT)VCT is the time interval between two consecutive virtual clock ticks (of the VM)VCT is the VM response time; it is analogous to the RTT of a network flowUse VCT (or derivative thereof) to generate feedback signal

Page 3: Friendly Virtual Machines Motivation: Trend #1cs-pub.bu.edu/faculty/best/research/talks/FVM.pdf · Yuting Zhang, Mina Guirguis, Ibrahim Matta, and Richard West First ACM/USENIX Conference

3

06/11/2005 FVM @ VEE'05 13

VCT: Illustration #1

Infrastructure(Hardware)

Hosting Environment(OS/VMM)

VM1 VM2 VM3 VM4

Realtime

0:00 0:00 0:000:00

06/11/2005 FVM @ VEE'05 14

VCT: Illustration #1

Infrastructure(Hardware)

Hosting Environment(OS/VMM)

VM2 VM3 VM4

Realtime

0:00 0:000:00

t1

VM1

0:01

06/11/2005 FVM @ VEE'05 15

VCT: Illustration #1

Infrastructure(Hardware)

Hosting Environment(OS/VMM)

VM1 VM3 VM4

Realtime

0:01 0:000:00

t1

VM2

0:01

06/11/2005 FVM @ VEE'05 16

VCT: Illustration #1

Infrastructure(Hardware)

Hosting Environment(OS/VMM)

VM2 VM3 VM4

Host time(Real time)

0:01 0:000:00

t1 t2

VCT

VM1

0:02

06/11/2005 FVM @ VEE'05 17

VCT: Illustration #2

Infrastructure(Hardware)

Hosting Environment(OS/VMM)

VM2 VM3 VM4

Realtime

0:00 0:000:00

t1

VM1

0:01

06/11/2005 FVM @ VEE'05 18

VCT: Illustration #2

Infrastructure(Hardware)

Hosting Environment(OS/VMM)

VM1 VM3 VM4

Realtime

0:01 0:000:00

t1

VM2

0:01

Page 4: Friendly Virtual Machines Motivation: Trend #1cs-pub.bu.edu/faculty/best/research/talks/FVM.pdf · Yuting Zhang, Mina Guirguis, Ibrahim Matta, and Richard West First ACM/USENIX Conference

4

06/11/2005 FVM @ VEE'05 19

VCT: Illustration #2

Infrastructure(Hardware)

Hosting Environment(OS/VMM)

VM1 VM2 VM3 VM4

0:01 0:01 0:000:01

Realtimet1

06/11/2005 FVM @ VEE'05 20

VCT: Illustration #2

Infrastructure(Hardware)

Hosting Environment(OS/VMM)

VM1 VM2 VM3 VM4

0:01 0:01 0:010:01

Realtimet1

06/11/2005 FVM @ VEE'05 21

VCT: Illustration #2

Infrastructure(Hardware)

Hosting Environment(OS/VMM)

VM2 VM3 VM4

Host time(Real time)

0:01 0:010:01

t1 t2

VCT

VM1

0:02

06/11/2005 FVM @ VEE'05 22

VCT: A Barometer of Load

VCT grows with load (e.g., #VMs) Slow growth ~ Linear EfficientSuperlinear Thrashing Inefficient

ρ

Measu

red

VC

T

VM

Serv

ice R

ate

1 1ρ

Thrashing

06/11/2005 FVM @ VEE'05 23

FVM: Congestion Signal

R > Threshold (H) Congestion = Truewhere H ~ VCT*/VCTmin

EWMA VCT:

Minimum VCT:

Slowdown:

ρ

VCT(t)

1

VCTmin

VCT*

06/11/2005 FVM @ VEE'05 24

FVM: Consumption Control

Multi-Programming Level (MPL) Control:A thread as a unit of consumption of host resources; VM is a multi-threaded application# of active threads allowed for a VM constitute a cap on its resource consumptionAdjust # of active threads through suspension or resumption of threads within a VM

Rate Control: Force VM to periodically sleep (or timeout)

A la TCP window

adaptation

A la TCP timeout

Page 5: Friendly Virtual Machines Motivation: Trend #1cs-pub.bu.edu/faculty/best/research/talks/FVM.pdf · Yuting Zhang, Mina Guirguis, Ibrahim Matta, and Richard West First ACM/USENIX Conference

5

06/11/2005 FVM @ VEE'05 25

FVM: MPL Control

Infrastructure(Hardware)

Hosting Environment(OS/VMM)

VM VM VM VM

06/11/2005 FVM @ VEE'05 26

FVM: Rate (timeout) Control

Infrastructure(Hardware)

Hosting Environment(OS/VMM)

VM VM VM VM

06/11/2005 FVM @ VEE'05 27

Controller: Adaptation Strategy

AIMD (Additive-increase/Multiplicative-decrease)

Adjust # of threadsNo Congestion threadmax = threadmax + a;Congestion threadmax = threadmax / b;

Adjust execution rate (timeout period)No Congestion rate = rate + a;Congestion rate = rate / b;

Different increase/decrease rules that match application requirements (e.g., smoother adaptation) could co-exist as long as they are “compatible” [JinGuoBestavrosMatta’02]

06/11/2005 FVM @ VEE'05 28

Host: Requirements

Required: Unbiased On-Demand Allocation

RR scheduler

Desirable:Policing Functionality (friendliness incentive)

Identify/penalize misbehaving applications

06/11/2005 FVM @ VEE'05 29

FVM: Framework

06/11/2005 FVM @ VEE'05 30

FVM: Analytic Model

# of VM threads

Total resource usage

VCT slowdown

Congestion signal

Average VCT slowdown

Page 6: Friendly Virtual Machines Motivation: Trend #1cs-pub.bu.edu/faculty/best/research/talks/FVM.pdf · Yuting Zhang, Mina Guirguis, Ibrahim Matta, and Richard West First ACM/USENIX Conference

6

06/11/2005 FVM @ VEE'05 31

FVM: Analytic Model Results

Linearized model allows us to: Relate convergence & transient characteristics to parameters, e.g., AIMD/EWMA constants, various delays, gain, …Sketch adaptation transients numerically

06/11/2005 FVM @ VEE'05 32

Congestion signal constitutes prices fed back to VMs as the load on the host varies

Convergence and stability can be proved through Lyapunov function [Kelly’99]

FVM: Convergence

Demand

Price Host CapacityHost (or plant) sets

prices based on load

VM controller setsdemand based on price

Load

06/11/2005 FVM @ VEE'05 33

f-UML: A FVM Prototype

Based on User Mode Linux (UML) VMUML is a VM abstraction that allows guest Linux systems to run at user-level on top of a Linux host

Added ~ 500 lines to UML code VCT measurement, congestion signal generation, and controller implemented in a single function fvm_adapt() which is added to the time_handler()for SIGALRM/SIGVALRM

06/11/2005 FVM @ VEE'05 34

f-UML: Parameters

0.1 Hz (=1/Ts)AIMD additive constant (rate control)

1.5AIMD multiplicative constant

1 threadAIMD additive constant (MPL control)

2.5Slowdown threshold

10Initial limit on the number of thread

0.3EWMA constant for VCT

60 secWindow of VCTmin

5 secControl Period

SettingParameter

06/11/2005 FVM @ VEE'05 35

f-UML: Evaluation

Web server experiments4 VMs on host, with Apache 2.0 running on each VMClient requests invoke memory-bound CGI scripts

VMs testedOriginal UMLf-UML prototype (with MPL control)

Metrics (per VM & averaged over 4 VMs) VCTThroughputFairness Index

06/11/2005 FVM @ VEE'05 36

f-UML vs UML: Baseline Results

UML

f-UML

UML

f-UML

Page 7: Friendly Virtual Machines Motivation: Trend #1cs-pub.bu.edu/faculty/best/research/talks/FVM.pdf · Yuting Zhang, Mina Guirguis, Ibrahim Matta, and Richard West First ACM/USENIX Conference

7

06/11/2005 FVM @ VEE'05 37

f-UML vs UML: Throughput

UML f-UML

06/11/2005 FVM @ VEE'05 38

f-UML vs UML: Fairness

UML

f-UML

UML

f-UML

UML

f-UML

06/11/2005 FVM @ VEE'05 39

FVM: Food for Thought

VM resource consumption throttling:What if all threads are not created equal? Which thread should be suspended?

FVM framework extensions:Other feedback signals? adaptation mechanisms? …Extension to friendliness over host clusters, grids, …

Friendly wrappers: Could an application be made friendly post-mortem? Could friendliness be “strongly typed”? What is the role of compilers in casting friendliness?

06/11/2005 FVM @ VEE'05 40

Take Home Messages

VM FriendlinessThe incarnation of the E2E argument for multi-resource management in shared hosting environmentsA resource consumption etiquette that leaves the choice of mechanism used for compliance to the application

FVM FrameworkLends itself well to emerging open VM hosting systemsReduces significantly the complexity of underlying hostf-UML implementation establishes feasibility

http://www.cs.bu.edu/groups/wing

Friendly Virtual MachinesLeveraging a Feedback-Control Model for Application Adaptation

First ACM/USENIX Conference on Virtual Execution Environments (VEE'05)

June 11th, 2005

More information available from WING Publicationshttp://www.cs.bu.edu/groups/wing