Title: SCHEDULING FOR TODAY
1SCHEDULING FOR TODAYS COMPUTER SYSTEMSBRIDGING
THEORY AND PRACTICE
Adam Wierman
2SCHEDULING SUCCESS STORIES ARE EVERYWHERE
Biersack, Rai, Urvoy-Keller, Harchol-Balter,
Schroeder, Agrawal, Ganger, Petrou, Misra, Feng,
Hu, Zhang, Mangharam, Sadowsky, Rawat, Dinda,
McWherter, Ailamaki, others
3THE ESSENCE OF A SCHEDULING SUCCESS STORY
web server, edge router, etc.
Goal Minimize user response times
4SRPT WINS BIG
WHAT POLICY SHOULD WE USE?
SRPT
Assumption M/GI/1 Queue
5HOW DO REAL SYSTEMS DIFFER?
63 TYPES OF GAPS BETWEEN THEORY AND PRACTICE
Idealized policiesThe idealized policies studied
in theory cannot be used in practice
Limited metricsMany performance metrics that are
important in practice are not studied in theory
Simplistic modelsTraditional models include many
unrealistic assumptions
7THE GOAL OF THE THESIS BRIDGE THE GAPS BETWEEN
THEORY AND PRACTICE
8IDEALIZED POLICIES
SRPT
9SRPT
10IDEALIZED POLICIES
SRPT
SMART
SMARTe
11THE SMART CLASS
SMAll Response Times
- Bias Property
- Consistency Property
- Transitivity Property
12TWO NOTIONS OF SMALL JOBS
small original size
small remaining size
13BIAS PROPERTY
If OriginalSize(a) lt RemainingSize(b) then a has
priority over b
a
b
Sigmetrics 2005a
14BIAS PROPERTY
If OriginalSize(a) lt RemainingSize(b) then a has
priority over b
Sigmetrics 2005a
15BIAS PROPERTY
If OriginalSize(a) lt RemainingSize(b) then a has
priority over b
lower priority
remaining size
?
higher priority
0
original size
0
Sigmetrics 2005a
16EXAMPLES
If OrigSize(a) lt RemSize(b) then a has priority
over b
Many others!
17IDEALIZED POLICIES
SRPT
SMART
SMARTe
18ANALYSIS SETTING
APPROACH
ETSMART
Bound T(x)SMART
19CONDITIONAL RESPONSE TIME UNDER SMART POLICIES
Theorem Under the M/GI/1, for all SMART policies
P,
Response time for a job of size x
Sigmetrics 2005a
20CONDITIONAL RESPONSE TIME UNDER SMART POLICIES
Theorem Under the M/GI/1, for all SMART policies
P,
Picture proof Waiting time
remaining size
?
21SMART POLICIES ARE 2-COMPETITIVE
Sigmetrics 2005a
22SMART POLICIES ARE 2-COMPETITIVE
SRPT
23IDEALIZED POLICIES
SRPT
SMART
SMARTe
24SMART
SMARTe
If OrigSize(a) x and e(x) lt RemSize(b) then a
has priority over b
If OrigSize(a) lt RemSize(b) then a has priority
over b
25SMARTe
If OrigSize(a) x and e(x) lt RemSize(b) then a
has priority over b
How can you characterize job size estimates?
e(x) x error
e(x) can also be defined to include 2-level
policies
26SMARTe POLICIES ARE CONSTANT COMPETITIVE
Theorem In an M/GI/1 under SMARTe policy P
f bounds the SIZE of larger jobs that get higher
priority
d bounds the LOAD of larger jobs that get higher
priority
27real sizes ? web server trace
estimates ? within 50
WHAT DOES THIS TRANSLATE TO IN PRACTICE?
SMARTe
SRPT
28IDEALIZED POLICIES
SRPT
SMART
SMARTe
29MUCH MORE WORK ON CLASSIFICATIONS
Analyzing the SMART class beyond ET
Introducing analyzing other classifications
Sigmetrics 2005a Sigmetrics 2006 Perf. Eval.
Review 2006 Operations Research 2007
Sigmetrics 2003Sigmetrics 2005b Perf. Eval.
Review 2006
Collaborations with Zwart, Nuyens, Shakkottai,
Yang, Harchol-Balter, Osogami, and others
Freidman and Hurley, 2004Rai, Urvoy-Keller,
Vernon, Biersack 2005 Nunez-Queija, Kherani
2006 Misra, Rubenstein, Feng 2007 Kherani
2007
30THE GOAL OF THE THESIS BRIDGE THE GAPS BETWEEN
THEORY AND PRACTICE
10 of the talk
30 of the talk
60 of the talk
31MEAN RESPONSE TIME
32MEAN RESPONSE TIME
Perf Eval 2002 Sigmetrics 2003 Sigmetrics
2005a PER 2007
Sigmetrics 2005bSigmetrics 2006 OR 2007
33ARE POLICIES THAT PRIORITIZE SMALL JOBS UNFAIR
TO LARGE JOBS?
34WHAT DOES FAIRNESS MEAN?
...it depends entirely on the application
OUR SETTING Are the response times of large jobs
unfairly long?
35WHY IS THIS FAIR?
Aristotles notion of fairness Like cases should
be treated alike, different cases should be
treated differently, and different cases should
be treated differently in proportion to their
differences.
Sigmetrics 2003 Best student paper award
36WHY IS THIS FAIR?
Rawls Theory of Social Justice All social
goods should be distributed equally,
unless unequal distribution is to the advantage
of the least favored
Sigmetrics 2003 Best student paper award
37WHY IS THIS FAIR?
Min-Max fairness (Pareto Efficiency) All jobs
deserve an equal share of the resources ... but
if some jobs can use more without hurting others,
thats okay
Sigmetrics 2003 Best student paper award
38HOW UNFAIR ARE SMART POLICIES?
Theorem For all service distributions, SRPT is
fair if ?0.5.
Theorem For all power law (a) service
distributions with a lt 1.5, all SMART policies
are fair.
39BUT SMART POLICIES CAN BE UNFAIR
SMART
the largest jobs are treated the same as under PS
Theorem For all service distributions with
finite variance, all SMART policies are unfair
for high enough load.
40FAIRNESS AND CLASSIFICATIONS
Always Unfair
Always Fair
SRPT
PS
Sometimes Fair
Sigmetrics 2003 Best student paper award
41FAIRNESS AND CLASSIFICATIONS
Always Unfair
Always Fair
Remaining size based
LRPT
SRPT
SMART
FOOLISH
PLCFS
Preemptivesize based
PSJF
PLJF
SYMMETRIC
LAS
Age based
PS
Sometimes Fair
FCFS
PROTECTIVE
Non-preemptive non-size based
LCFS
FSP
Sigmetrics 2003 Best student paper award
42MUCH MORE WORK ON FAIRNESS
defining other types of fairness
analyzing policies classifications
Under submission
Perf. Eval 2002 Sigmetrics 2003
Raz, Avi-Itzhak 2004 Levy, Raz, Avi-Itzhak
04 Sandmann 2005
extending definition to higher moments
Many other papers by Henderson,
Friedman, Biersack, Rai, Ayesta, Aalto,
Nunez-Queija, Misra, Feng, Vernon, Williamson,
Brown, Bansal, and others
Sigmetrics 2005b Under submission
Williamson, Gong 2003, 2004 Brown 2006 and
others.
43THE GOAL OF THE THESIS BRIDGE THE GAPS BETWEEN
THEORY AND PRACTICE
10 of the talk
30 of the talk
60 of the talk
44M/GI/1
45M/GI/1
PER 2004QUESTA 2005 Perf Eval 2006
NSDI 2006
46REAL USERS ARE INTERACTIVE
47Closed System
users75
NSDI 2006
48REAL USERS ARE NOT OPEN OR CLOSED
load 0.7
CLOSED
OPEN
NSDI 2006
49Kasparov vs. Deep Blue
world cup site
online shopping
CMU web server
online gaming site
slashdotted site
CLOSED
OPEN
NSDI 2006
50USER BEHAVIOR IMPACTS SYSTEM DESIGN
51THE GOAL OF THE THESIS BRIDGE THE GAPS BETWEEN
THEORY AND PRACTICE
10 of the talk
30 of the talk
60 of the talk
52THE GOAL OF THE THESIS BRIDGE THE GAPS BETWEEN
THEORY AND PRACTICE
Fairness QoS Pr(Tgtx)
Interactive users Multiserver systems
Scheduling classifications
53Adam WiermanCarnegie Mellon Universityacw_at_cs.cmu
.eduThe thesis is available at
http//www.cs.cmu.edu/acw/thesis
54(No Transcript)
55SMART?
FOOLISH
SMART
FOOLISH
SMART
Remaining size based
LRPT
SRPT
RS
Preemptive size based
PSJF
PLJF
FSP
PROTECTIVE
Non-preemptive
Blind
PS
PLCFS
Non-preemptive size based
ROS
SYMMETRIC
LCFS
SJF
FCFS
Age based
LJF
FB
56THE BIAS PROPERTYISNT ENOUGH
CONSISTENCY
If a is served ahead of b then a will always have
priority over b
TRANSITIVITY
If an arriving job b preempts c, then until b
leaves, every arriving job a with original size
smaller than b has priority over c.
remaining size
?
at most 1 has higher priority
orig. size
Sigmetrics 2005a
57 Theorem
2b
58DO YOU USE AN OPEN OR CLOSED MODEL?
Surge
SPECWeb
TPC-W
Sclient
RUBiS
WebBench
Webjamma
httperf
59Theorem In an M/GI/1 with an unbounded, continuou
s service distribution having finite EX2, under
any non-idling policy we have and further
Wierman and Harchol-Balter 2003
60First Come First Served
The unfairness can be unbounded
ET(x) / x
PS
FCFS
x
Under a Pareto with ?0.8, this is gt80 of the
jobs
61FAIRNESS VS. EFFICIENCY
Always Unfair
SRPT
LRPT
Always Fair
PLJF
PSJF
LCFS
Sometimes Fair
ROS
FCFS
SJF
LJF
more circles? better mean response time
FB
62Fair Sojourn Protocol (FSP)
Do SRPT on the PS remaining times
63 Raw moments ET(x)i Central moments
VarT(x), etc Cumulant moments
ET(x) ? ?
X
BEYOND EXPECTATION Higher Moments
X
Wierman and Harchol-Balter 2005
64CUMULANTS
Cumulants are a descriptive statistic, similar to
the moments. They can be found as a function
of the moments or from the log of the moment
generating function
65WHYCUMULANTS?
Cumulants have many nice properties
additivity
homogeneity
1st cumulant is shift-equivariant the rest are
shift-invariant
66MIN-MAX FAIRNESS
Wierman and Harchol-Balter 2005
Definition Consider an M/GI/1 queue. A policy P
is min-max fair if, for all i
67TEMPORAL FAIRNESS
It is unfair to violate the seniority of a job
Definition The politeness experienced by a job
of size x under policy P, Pol(x)P, is the
fraction of the response time during which the
seniority of the job is respected.
Wierman 2004
68FCFS
FCFS
SRPT
FSP
PS
PLCFS
FSP
SRPT
PS
LRPT
LRPT
PLCFS
69FCFS
SRPT
FSP
PS
more circles? better mean response time
LRPT
PLCFS
70MANY OTHER INTERESTING FAIRNESS METRICS
Levy, Raz, Avi-Itzhak 04
- DiscFreq ni cmi
- ni number of jobs that arrived later and
completed earlier than job i - mi number of larger jobs (at the arrival of job
i) that complete earlier than job i
71SMART POLICIES ARE 2-COMPETITIVE
Consider the M/D/1
SRPT does FCFS (only in M/D/1). So as ??1
PLCFS is in SMART (only in M/D/1)
As ??1, ETPLCFS ? 2 ETSRPT
72- Use a parameterized policy setthat is (nearly)
dense in SMART,e.g. iRj S - Search (i,j) space for policy thatoptimizes
secondary objectives,e.g. fairness and
predictability
ONLINE MULTI-OBJECTIVE SCHEDULING USING SMART
73B
A
B
C
A
D
remaining size
PSJF
D
C
time
74B
A
?
B
A
D
remaining size
PSJF
PSJF
D
C
SRPT
time
75TAIL BEHAVIOR OF SMART
Pr(Tgty) is difficult to study directly so it is
typically it is studied asymptotically
76LARGE BUFFER SCALING
LIGHT-TAILED JOB SIZES
HEAVY-TAILED JOB SIZES
X is light-tailed if for some sgt0 For this
talk, assume no mass in the upper bound.
X is of intermediate regular variation if
77SMART POLICIES ARE ASYMPTOTICALLY EQUIVALENT
- Theorem Under the GI/GI/1, for all SMART
policies - when the service distribution is light-tailed
with no mass in - the endpoint
- when the service distribution is of intermediate
regular variation
busy period length
Nuyens, Wierman, Zwart 2005
78SMART POLICIES ARE ASYMPTOTICALLY EQUIVALENT
LIGHT-TAILED JOB SIZES
HEAVY-TAILED JOB SIZES
worse
worse
SMART LCFS SJF
Pr(Tgty) workload
Log Pr(Tgty) busy period
SMART
Pr(Tgty) busy period
Log Pr(Tgty) workload
Nunez-Queija, Boxma, Zwart, Borst, Nuyens, and
many others
79TAIL BEHAVIOR OF SMART
Pr(Tgty) is difficult to study directly so it is
typically it is studied asymptotically
80MANY SOURCES SCALING
decay rate
Yang, Wierman, Shakkottai, Harchol-Balter, 2006
81T(x) RESULT, plot for ET(x)
SMART POLICIES ARE ASYMPTOTICALLY EQUIVALENT
Theorem For all e, x, y gt 0 where PRIO is a 2
class priority queueing policy.
Empty!
Picture proof
Yang, Wierman, Shakkottai, Harchol-Balter, 2006
82T(x) RESULT, plot for ET(x)
TAIL BEHAVIOR OF SMARTe POLICIES
- Theorem Under the M/GI/1, for all SMARTe
- when the service distribution is unbounded and
light-tailed - with no mass in the endpoint
- when the service distribution is of intermediate
regular variation - and
busy period length
Nuyens, Wierman, under preparation
83HOW QUICKLY DOES CLOSED ? OPEN?
Open
Web Workloads
Closed (MPL1000)
Closed (MPL100)
Closed (MPL10)
84CHOOSING A SYSTEM MODEL
Web workloads
- A site being Slashdotted
- Online gaming site
- Science Institute - USGS
- Online dept. store
- Financial service provider
- Kasparov vs Deep Blue
- CMU web server
- World cup site
Open or closed?
Use a partly-open model...
85FITTING A PARTLY-OPEN MODEL
file sizes from trace
86FITTING A PARTLY-OPEN MODEL
- Fitting the interarrival times
- Distinguish userse.g. use ip address in a web
trace - Identify user session boundaries ? Use periods
of inactivity of length gt timeout
Cant use trace directly because
dependencies between completions and follow-up
requests would be lost!
87CHOOSING A TIMEOUT VALUE
88HOW TO CHOOSE A SYSTEM MODEL
How many simult. users are there?
Gather a trace
89MULTISERVER QUEUES
- Preemptive-Resume Priority
- Homogeneous hosts
90HOW MANY SERVERS ARE BEST?
1 fast (rate 1) vs. k slow (rate 1/k)
4 best
3 best
2 best
1 best
91GAPS BETWEEN THEORY AND PRACTICE
What about power usage?
What about time-varying workloads?
What about user impatience?
92warning
Remember