74
TASK-AWARE VIRTUAL MACHINE SCHEDULING FOR I/O PERFORMANCE Hwanju Kim , Hyeontaek Lim, Jinkyu Jeong, Heeseung Jo (Korea Advanced Institute of Science and Technology) Joonwon Lee (Sungkyunkwan Univ.) VEE 2009 March 13

Task-aware Virtual Machine Scheduling for I/O Performance

Embed Size (px)

DESCRIPTION

Hwanju Kim, Hyeontaek Lim, Jinkyu Jeong, Heeseung Jo, and Joonwon Lee, “Task-aware Virtual Machine Scheduling for I/O Performance”, ACM SIGPLAN/SIGOPS International Conference on Virtual Execution Environments (VEE), Washington, DC, USA, Mar. 2009.

Citation preview

Page 1: Task-aware Virtual Machine Scheduling for I/O Performance

TASK-AWARE VIRTUAL MACHINE SCHEDULING FOR I/O PERFORMANCE

Hwanju Kim, Hyeontaek Lim, Jinkyu Jeong, Heeseung Jo (Korea Advanced Institute of Science and Technology)

Joonwon Lee (Sungkyunkwan Univ.)VEE 2009 March 13

Page 2: Task-aware Virtual Machine Scheduling for I/O Performance

Virtual Machine Consolidation

Centralized various computing environmentsVirtual desktop infrastructure

VMware, Sun, HP, MSCloud computing

Amazon EC2

Page 3: Task-aware Virtual Machine Scheduling for I/O Performance

Virtual Machine Consolidation

Centralized various computing environmentsVirtual desktop infrastructure

VMware, Sun, HP, MSCloud computing

Amazon EC2

Unpredictable workloads due to the diversity

Page 4: Task-aware Virtual Machine Scheduling for I/O Performance

Virtual Machine Consolidation

Performance enhancementParavirtualizationHardware-assisted techniques

Intel VT, AMD SVMOptimization

Page 5: Task-aware Virtual Machine Scheduling for I/O Performance

Virtual Machine Consolidation

Performance enhancementParavirtualizationHardware-assisted techniques

Intel VT, AMD SVMOptimization

High degree of consolidation

Page 6: Task-aware Virtual Machine Scheduling for I/O Performance

Virtual Machine Consolidation

Performance enhancementParavirtualizationHardware-assisted techniques

Intel VT, AMD SVMOptimization

High degree of consolidation

Unpredictable workloads

Intelligent CPUmanagement can improve

the performance

Page 7: Task-aware Virtual Machine Scheduling for I/O Performance

BackgroundA semantic gap between the VMM and a guest OS

VMM’s lack of knowledge of VM internal

No tracking characteristics of guest-level tasks

Internal workload-agnostic scheduling

Poor decision about “when” to schedule a VM

Simple design of the VMM

Low overheadsLow TCB

OS awareness

Efficient resource management

Page 8: Task-aware Virtual Machine Scheduling for I/O Performance

BackgroundTask-unawareness leading to poor responsiveness

VM

(VCPU)

VM

(VCPU)

Head TailRun queue sorted based on CPU fairness

I/O-

bound

task

I/O-

bound

task

CPU-

bound

task

mixed

task

VMM

Page 9: Task-aware Virtual Machine Scheduling for I/O Performance

BackgroundTask-unawareness leading to poor responsiveness

VM

(VCPU)

VM

(VCPU)

Head TailRun queue sorted based on CPU fairness

I/O-

bound

task

I/O-

bound

task

CPU-

bound

task

mixed

task

VMM

I/O event

Page 10: Task-aware Virtual Machine Scheduling for I/O Performance

BackgroundTask-unawareness leading to poor responsiveness

VM

(VCPU)

VM

(VCPU)

Head TailRun queue sorted based on CPU fairness

I/O-

bound

task

I/O-

bound

task

CPU-

bound

task

mixed

task

VMM

I/O event

That event

is mine!

Page 11: Task-aware Virtual Machine Scheduling for I/O Performance

BackgroundTask-unawareness leading to poor responsiveness

VM

(VCPU)

VM

(VCPU)

Head TailRun queue sorted based on CPU fairness

I/O-

bound

task

I/O-

bound

task

CPU-

bound

task

mixed

task

VMM

I/O event

That event

is mine!

I have no idea this incoming event is yours

andyour VM has low priority now.Sorry not to schedule you..

Responsiveness VS. Fairness

Page 12: Task-aware Virtual Machine Scheduling for I/O Performance

BackgroundTask-unawareness leading to poor responsiveness

VM

(VCPU)

VM

(VCPU)

Head TailRun queue sorted based on CPU fairness

I/O-

bound

task

I/O-

bound

task

CPU-

bound

task

mixed

task

VMM

I/O event

That event

is mine!

I have no idea this incoming event is yours

andyour VM has low priority now.Sorry not to schedule you..

Responsiveness VS. Fairness

Page 13: Task-aware Virtual Machine Scheduling for I/O Performance

BackgroundThe worst case example for 6 domains consolidated

0

0.2

0.4

0.6

0.8

1

0 2 4 6 8 10

CDF

Response time (ms)

Native Linux(I/O+CPU)XenoLinux(I/O)

XenoLinux(I/O+CPU)

Workloads1 dom: Server & CPU-bound task5doms: CPU-bound task

Page 14: Task-aware Virtual Machine Scheduling for I/O Performance

BackgroundThe worst case example for 6 domains consolidated

0

0.2

0.4

0.6

0.8

1

0 2 4 6 8 10

CDF

Response time (ms)

Native Linux(I/O+CPU)XenoLinux(I/O)

XenoLinux(I/O+CPU)

Workloads1 dom: Server & CPU-bound task5doms: CPU-bound task

Page 15: Task-aware Virtual Machine Scheduling for I/O Performance

BackgroundThe worst case example for 6 domains consolidated

0

0.2

0.4

0.6

0.8

1

0 2 4 6 8 10

CDF

Response time (ms)

Native Linux(I/O+CPU)XenoLinux(I/O)

XenoLinux(I/O+CPU)

By boosting mechanism ofXen Credit scheduler

Boosting mechanism realizesI/O boundness with only VCPU-level

Workloads1 dom: Server & CPU-bound task5doms: CPU-bound task

Page 16: Task-aware Virtual Machine Scheduling for I/O Performance

Main GoalsImprove responsiveness of an I/O-bound task

Priority boosting with task-level granularity

“Partial boosting”

CPU fairness guarantee

Transparency

Low management overheads

Page 17: Task-aware Virtual Machine Scheduling for I/O Performance

Issues

How to identify an I/O-bound task

How to know an incoming event is for the I/O-bound task

Page 18: Task-aware Virtual Machine Scheduling for I/O Performance

ApproachNon-intrusive approach

No guest OS modificationNo explicit interface to inform I/O-bound task and event data

Pros.No additional engineering cost for different OSes Strong trustworthiness

Cons.False decision

Page 19: Task-aware Virtual Machine Scheduling for I/O Performance

HOW TO IDENTIFY I/O-BOUND TASKS

Page 20: Task-aware Virtual Machine Scheduling for I/O Performance

Tracking I/O-bound TasksObservable information at the VMM

Task switching

Monitoring address space changes (Antfarm USENIX’06)

CPU time usage

Running time of a task

eventCR3 update CR3 update

Task running time

Timerd

tsc(

)

rdtsc(

)

Example (x86)

Page 21: Task-aware Virtual Machine Scheduling for I/O Performance

Tracking I/O-bound TasksInference based on common gray-box knowledge

Kernel policy to improve responsiveness of I/O-bound tasks

An I/O-bound task is preemptively scheduled in response to its incoming event

Characteristic of I/O-bound tasks

Short running time

Threshold to decide a short running time: IOthreashold

Page 22: Task-aware Virtual Machine Scheduling for I/O Performance

Tracking I/O-bound TasksThree disjoint observation classes based on two gray-box criteria

Positive evidencesupports I/O-boundness

Negative evidencesupports non-I/O-boundness

AmbiguityNo evidence

Positive

evidence

Negative

evidence

Ambiguity

Observation

Preemptively scheduling in response to an event&

Short running time( < IOthreshold )

Page 23: Task-aware Virtual Machine Scheduling for I/O Performance

Tracking I/O-bound TasksExample

Time

Event pendingto VCPU1

Positive Negative Ambiguity

IOthreshold

Page 24: Task-aware Virtual Machine Scheduling for I/O Performance

Tracking I/O-bound TasksExample

Time

Event pendingto VCPU1

SchedulingVCPU1

T1

Positive Negative Ambiguity

IOthreshold

Page 25: Task-aware Virtual Machine Scheduling for I/O Performance

Tracking I/O-bound TasksExample

Time

Event pendingto VCPU1

SchedulingVCPU1

T1 T2

Positive Negative Ambiguity

IOthreshold

Page 26: Task-aware Virtual Machine Scheduling for I/O Performance

Tracking I/O-bound TasksExample

Time

Event pendingto VCPU1

SchedulingVCPU1

T1 T2

Positive Negative Ambiguity

T1

IOthreshold

Page 27: Task-aware Virtual Machine Scheduling for I/O Performance

Tracking I/O-bound TasksExample

Time

Event pendingto VCPU1

SchedulingVCPU1

T1 T2 T3

Positive Negative Ambiguity

T1

IOthreshold

Page 28: Task-aware Virtual Machine Scheduling for I/O Performance

Tracking I/O-bound TasksExample

Time

Event pendingto VCPU1

SchedulingVCPU1

T1 T2 T3

Positive Negative Ambiguity

T1T2

IOthreshold

Page 29: Task-aware Virtual Machine Scheduling for I/O Performance

Tracking I/O-bound TasksExample

Time

Event pendingto VCPU1

SchedulingVCPU1

T1 T2 T3 T4

Positive Negative Ambiguity

T1T2

IOthreshold

Page 30: Task-aware Virtual Machine Scheduling for I/O Performance

Tracking I/O-bound TasksExample

Time

Event pendingto VCPU1

SchedulingVCPU1

T1 T2 T3 T4

Positive Negative Ambiguity

T1T2 T3

IOthreshold

Page 31: Task-aware Virtual Machine Scheduling for I/O Performance

Tracking I/O-bound TasksExample

Time

Event pendingto VCPU1

SchedulingVCPU1

T1 T2 T3 T4 T5

Positive Negative Ambiguity

T1T2 T3

IOthreshold

Page 32: Task-aware Virtual Machine Scheduling for I/O Performance

Tracking I/O-bound TasksExample

Time

Event pendingto VCPU1

SchedulingVCPU1

T1 T2 T3 T4 T5

Positive Negative Ambiguity

T1T4T2 T3

IOthreshold

Page 33: Task-aware Virtual Machine Scheduling for I/O Performance

Tracking I/O-bound TasksExample

Time

Event pendingto VCPU1

SchedulingVCPU1

T1 T2 T3 T4 T5 T6

Positive Negative Ambiguity

T1T4T2 T3

IOthreshold

Page 34: Task-aware Virtual Machine Scheduling for I/O Performance

Tracking I/O-bound TasksExample

Time

Event pendingto VCPU1

SchedulingVCPU1

T1 T2 T3 T4 T5 T6

Positive Negative Ambiguity

T1 T5T4T2 T3

IOthreshold

Page 35: Task-aware Virtual Machine Scheduling for I/O Performance

Tracking I/O-bound TasksExample

Time

Event pendingto VCPU1

SchedulingVCPU1

T1 T2 T3 T4 T5 T6

DeschedulingVCPU1

Positive Negative Ambiguity

T1 T5T4T2 T3

IOthreshold

Page 36: Task-aware Virtual Machine Scheduling for I/O Performance

Tracking I/O-bound TasksExample

Time

Event pendingto VCPU1

SchedulingVCPU1

T1 T2 T3 T4 T5 T6

DeschedulingVCPU1

Positive Negative Ambiguity

T1 T5T4 T6T2 T3

IOthreshold

Page 37: Task-aware Virtual Machine Scheduling for I/O Performance

Tracking I/O-bound TasksWeighted evidence accumulation

The degree of belief to reinforce the inference

Weight of positive evidence < Weight of negative evidence

More penalize for negative evidence

The degree of

belief

# of sequential observations

BelThreshold

At this time, this task is believed as an I/O-bound task

Page 38: Task-aware Virtual Machine Scheduling for I/O Performance

HOW TO KNOW AN INCOMING EVENT IS FOR AN I/O-BOUND TASK

Page 39: Task-aware Virtual Machine Scheduling for I/O Performance

Correlation MechanismTo distinguish an incoming event for I/O-bound task

Block I/O

Block read

Network I/O

Packet reception

Page 40: Task-aware Virtual Machine Scheduling for I/O Performance

Correlation Mechanism- Block I/O -

Request/response style

How to decide “T1 read B1” at the VMM

If T1 requests for reading B1 and T1 is I/O-boundCompletion event for B1 is for I/O-bound task

Page 41: Task-aware Virtual Machine Scheduling for I/O Performance

Correlation Mechanism- Block I/O -

Request/response style

How to decide “T1 read B1” at the VMM

If T1 requests for reading B1 and T1 is I/O-boundCompletion event for B1 is for I/O-bound task

When the VMM observes a read event, it checks whether the current task is I/O-bound

Page 42: Task-aware Virtual Machine Scheduling for I/O Performance

Correlation Mechanism- Block I/O -

Request/response style

How to decide “T1 read B1” at the VMM

If T1 requests for reading B1 and T1 is I/O-boundCompletion event for B1 is for I/O-bound task

But, how about “delayed read event” ?Guest OS dependent (e.g. block I/O scheduler)

When the VMM observes a read event, it checks whether the current task is I/O-bound

Page 43: Task-aware Virtual Machine Scheduling for I/O Performance

Correlation Mechanism- Block I/O -

Inspection window

False positive VS. False negative

T1 T2 T3user

kernel read

actual

read request

T4

inspection window

VMM

If an I/O-bound task in inspection windowThe actual read request is for I/O-bound task

Page 44: Task-aware Virtual Machine Scheduling for I/O Performance

Correlation Mechanism- Network I/O -

Event identification

Socket-like information is too heavy for the VMM

Destination port number for TCP/IP communication

Most specific to a recipient task

Asynchronous packet reception

No prior information about incoming packets

History-based prediction mechanism

Page 45: Task-aware Virtual Machine Scheduling for I/O Performance

Correlation Mechanism- Network I/O -

History-based prediction mechanism

Inference

“If an incoming packet is for I/O-bound task, this packet makes the I/O-bound task to be preemptively scheduled”

Monitoring the first woken task in response to an incoming packet

Page 46: Task-aware Virtual Machine Scheduling for I/O Performance

Correlation Mechanism- Network I/O -

History-based prediction mechanism (cont’)

PortmapAn entry for each destination port numberEach entry is an N-bit saturating counter

Example (2-bit counter)

If the first woken task is I/O-bound

Otherwise

00non-

I/O-bound

01weak

I/O-bound

10I/O-bound

11strong

I/O-bound

portmap

Page 47: Task-aware Virtual Machine Scheduling for I/O Performance

Correlation Mechanism- Network I/O -

History-based prediction mechanism (cont’)

PortmapAn entry for each destination port numberEach entry is an N-bit saturating counter

Example (2-bit counter)

If the first woken task is I/O-bound

Otherwise

00non-

I/O-bound

01weak

I/O-bound

10I/O-bound

11strong

I/O-bound

portmap

If portmap counter’s MSB is set, this packet is for I/O-bound

Page 48: Task-aware Virtual Machine Scheduling for I/O Performance

PARTIAL BOOSTING

Page 49: Task-aware Virtual Machine Scheduling for I/O Performance

Partial BoostingPriority boosting with task-level granularity

Priority boosting lasts during the run of an I/O-bound task

Why?

To prevent CPU-bound tasks in a boosted VCPU from compromising CPU fairness

Page 50: Task-aware Virtual Machine Scheduling for I/O Performance

Partial BoostingProcedure

Head TailRun queue sorted based on CPU fairness

VM1

(VCPU)

VM2

(VCPU)

VMM

VM3

CPU-

bound

task

CPU-

bound

task

I/O-

bound

task

Page 51: Task-aware Virtual Machine Scheduling for I/O Performance

Partial BoostingProcedure

Head TailRun queue sorted based on CPU fairness

VM1

(VCPU)

VM2

(VCPU)

VMM

I/O event

VM3

CPU-

bound

task

CPU-

bound

task

I/O-

bound

task

If this event is inferred for an I/O-bound task in VM3, do partial boosting for VM3

Page 52: Task-aware Virtual Machine Scheduling for I/O Performance

Partial BoostingProcedure

Head TailRun queue sorted based on CPU fairness

VM1

(VCPU)

VM2

(VCPU)

VMM

I/O event

VM3

CPU-

bound

task

CPU-

bound

task

I/O-

bound

task

If this event is inferred for an I/O-bound task in VM3, do partial boosting for VM3

Page 53: Task-aware Virtual Machine Scheduling for I/O Performance

Partial BoostingProcedure

Head TailRun queue sorted based on CPU fairness

VM1

(VCPU)

VM2

(VCPU)

VMM

I/O event

VM3

CPU-

bound

task

CPU-

bound

task

I/O-

bound

task

If this event is inferred for an I/O-bound task in VM3, do partial boosting for VM3

Page 54: Task-aware Virtual Machine Scheduling for I/O Performance

Partial BoostingProcedure

Head TailRun queue sorted based on CPU fairness

VM1

(VCPU)

VM2

(VCPU)

VMM

I/O event

VM3

CPU-

bound

task

CPU-

bound

task

I/O-

bound

task

If this event is inferred for an I/O-bound task in VM3, do partial boosting for VM3

Page 55: Task-aware Virtual Machine Scheduling for I/O Performance

Partial BoostingProcedure

Head TailRun queue sorted based on CPU fairness

VM1

(VCPU)

VM2

(VCPU)

VMM

I/O event

VM3

CPU-

bound

task

CPU-

bound

task

I/O-

bound

task

If this event is inferred for an I/O-bound task in VM3, do partial boosting for VM3

Page 56: Task-aware Virtual Machine Scheduling for I/O Performance

IMPLEMENTATION & EVALUATION

Page 57: Task-aware Virtual Machine Scheduling for I/O Performance

ImplementationBased on Credit scheduler in Xen 3.2.1

Task information maintained by hash

Limited number of tasks maintained

Remove of a task with infrequent I/O

Correlation

Block I/O : using grant table in Xen

Network I/O : supported by network backend driver

No consideration of multiple VCPUs

Page 58: Task-aware Virtual Machine Scheduling for I/O Performance

EvaluationInteractive workload

Packet request-responseWorst case scenario1 dom: Server & CPU-bound task5doms: CPU-bound task

Think time: 100 ~ 1000 msIOthreshold = 0.5 ms

Page 59: Task-aware Virtual Machine Scheduling for I/O Performance

EvaluationInteractive workload

Packet request-responseWorst case scenario1 dom: Server & CPU-bound task5doms: CPU-bound task

Think time: 100 ~ 1000 msIOthreshold = 0.5 ms

Page 60: Task-aware Virtual Machine Scheduling for I/O Performance

EvaluationCorrelation evaluation

Partial boosting hit ratio (PBHR)

defined as true positive ratio

False positive ratio = (100 - PBHR) %

PBHR (%) =!

h

The number of partial boostings! 100

where

h ="

1 , if an I/O-bound task awakes during partial boosting.0 , otherwise.

Page 61: Task-aware Virtual Machine Scheduling for I/O Performance

EvaluationCorrelation evaluation: Block I/O

0

25

50

75

100

1 2 3 4 5 6 7 8 NC

PBHR (%)

PBH

R (%)

Inspection window size

Workloads1 dom: 8 tasks 1 task: I/O-bound task 7 tasks: I/O+CPU task (CPU usage 1~300ms between IOs) 5doms: CPU-bound task

Page 62: Task-aware Virtual Machine Scheduling for I/O Performance

EvaluationCorrelation evaluation: Block I/O

30

60

90

120

1 2 3 4 5 6 7 8 NC

Throughput

Thr

ough

put (

KB/

s)

Inspection window size

Workloads1 dom: 8 tasks 1 task: I/O-bound task 7 tasks: I/O+CPU task (CPU usage 1~300ms between IOs) 5doms: CPU-bound task

Page 63: Task-aware Virtual Machine Scheduling for I/O Performance

EvaluationCorrelation evaluation: Network I/O

0

25

50

75

100

1 2 4 NC

10

9390

64

PBH

R (%)

Bit-width of portmap counter

Workloads1 dom: 8 tasks 1 task: I/O-bound task 7 tasks: I/O+CPU task (CPU usage 1~300ms between IOs) 5doms: CPU-bound task

2-bit is reasonable in terms of space overheads

Page 64: Task-aware Virtual Machine Scheduling for I/O Performance

EvaluationResponse time for text editing during CPU-intensive workload

0

0.1

0.2

0.3

0.4

0.5

0.6

0.7

0.8

0.9

1

0 0.05 0.1 0.15 0.2 0.25 0.3

CDF

Response time (sec)

NormalTAVS

0

0.1

0.2

0.3

0.4

0.5

0.6

0.7

0.8

0.9

1

0 0.05 0.1 0.15 0.2 0.25 0.3

CDF

Response time (sec)

NormalTAVS

Text editing(Xen compilation)

Text editing(Web browsing with Flash animations)

Page 65: Task-aware Virtual Machine Scheduling for I/O Performance

EvaluationExecution time of I/O-bound tasks with CPU-intensive workloads

0

0.25

0.50

0.75

1.00

grep find wget smbcp

Nor

mal

ized

exe

cutio

n tim

e

Normal TAVS

compilation compressionBackground workload

smbcp: copy files from remote samba server

PBHR = 99%

Page 66: Task-aware Virtual Machine Scheduling for I/O Performance

EvaluationOverheads

Task tracking overheads: 0.06%

No overhead for inspecting incoming packets

Increased network throughput : decreased CPU throughput = 48 : 1

Space overhead of N-bit portmap

N * 8KB for each VM

e.g. 2-bit portmaps for TCP and UDP: 32KB for each VM

Page 67: Task-aware Virtual Machine Scheduling for I/O Performance

ConclusionsTask-aware VM scheduling

Bridging the semantic gap in CPU management

Transparency by VMM-level inference

Gray-box technique

Low overheads

Page 68: Task-aware Virtual Machine Scheduling for I/O Performance

Future WorkExtension on multicore system

Simulation-based analysis for more intelligent scheduling

Evaluation for more various workloads

Page 69: Task-aware Virtual Machine Scheduling for I/O Performance

THANK YOU!

Page 70: Task-aware Virtual Machine Scheduling for I/O Performance

BACKUP SLIDES

Page 71: Task-aware Virtual Machine Scheduling for I/O Performance

ImplementationBlock correlation

IDD Dom1

VMM

Hardware

Machine memory

1

Activegrant table

Dom1'srecent task list

1

Sharedgrant table Dom2

Dom2'srecent task list

T1 T3 T2 T3 T1

Page 72: Task-aware Virtual Machine Scheduling for I/O Performance

ImplementationNetwork correlation

IDD Dom1 Dom2

VMM

HardwareNIC

Dom1, TCP, 1000Dom2, UDP, 2000Dom2, TCP, 1000

Incoming packet information

Dom1'sportmap

Dom2'sportmap

Shared memory

update

Page 73: Task-aware Virtual Machine Scheduling for I/O Performance

Throughput

PBratio =Allowed CPU usage for partial boosting

Total CPU usage

0 5

10 15 20 25 30 35 40 45 50 55 60 65 70 75 80 85 90 95

100

Base 0 0.0625 0.125 0.25 0.5 0

5

10

15

20

25

CPU

usa

ge (%

)

Thro

ughp

ut (M

B/s)

PBratio

IDDDom1(I/O)Dom2Dom3Dom4Dom5Dom6Throughput

0 5

10 15 20 25 30 35 40 45 50 55 60 65 70 75 80 85 90 95

100

Base 0 0.0625 0.125 0.25 0.5 0

10

20

30

40

50

60

CPU

usa

ge (%

)

Thro

ughp

ut (M

bps)

PBratio

Page 74: Task-aware Virtual Machine Scheduling for I/O Performance

Degree of BeliefDegree of belief (grep, find + compilation)

-100-50

0 50

100 150 200 250 300

0 100 200 300 400

The

degr

ee o

f bel

ief

Elapsed time (sec)

grepcc1

-100-50

0 50

100 150 200 250 300

0 100 200

The

degr

ee o

f bel

ief

Elapsed time (sec)

findcc1