FINDING THE OPTIMAL QUANTUM SIZE Revisiting the M/G/1

FINDING THE OPTIMAL QUANTUM SIZE
Revisiting the M/G/1 Round-Robin Queue
VARUN GUPTA
Carnegie Mellon University
M/G/1/RR
Incomplete
jobs
Poisson
arrivals
Jobs served for q
units at a time
2
M/G/1/RR
Incomplete
jobs
Poisson
arrivals
Jobs served for q
units at a time
3
M/G/1/RR
Incomplete
jobs
Completed
jobs
Poisson
arrivals
Jobs served for q
units at a time
• arrival rate = 
• job sizes i.i.d. ~ S
• load
•
Squared coefficient of
variability (SCV) of job sizes:
C2  0
4
M/G/1/RR
q→0
M/G/1/PS
 Preemptions cause overhead
(e.g. OS scheduling)
preemption
overheads
small q
q
q=
M/G/1/FCFS
 Variable job sizes cause long delays
job size
variability
large q
5
GOAL
Optimal operating q for M/G/1/RR with overheads and high C2
effect of preemption overheads
SUBGOAL
Sensitivity Analysis: Effect of q and C2 on M/G/1/RR performance
(no switching overheads)
PRIOR WORK
• Lots of exact analysis: [Wolff70], [Sakata et al.71],
[Brown78]
 No closed-form solutions/bounds
 No simple expressions for interplay of q and C2
6
Outline
 Effect of q and C2 on mean response time
 Approximate analysis
 Bounds for M/G/1/RR
 Choosing the optimal quantum size
No preemption
overheads
Effect of
preemption
overheads
7
Approximate sensitivity analysis of
M/G/1/RR
Approximation assumption 1:
Service quantum ~ Exp(1/q)
Approximation assumption 2:
Job size distribution
8
Approximate sensitivity analysis of
M/G/1/RR
• Monotonic in q
– Increases from E[TPS] → E[TFCFS]
• Monotonic in C2
– Increases from E[TPS] → E[TPS](1+q)
For high C2: E[TRR*] ≈ E[TPS](1+q)
9
Outline
 Effect of q and C2 on mean response time
 Approximate analysis
 Bounds for M/G/1/RR
 Choosing the optimal quantum size
10
M/G/1/RR bounds
Assumption: job sizes  {0,q,…,Kq}
THEOREM:
Lower bound is TIGHT:
E[S] = iq
Upper bound is TIGHT within (1+/K):
Job sizes  {0,Kq}
11
Outline
 Effect of q and C2 on mean response time
 Approximate analysis
 Bounds for M/G/1/RR
 Choosing the optimal quantum size
12
Optimizing q
Preemption overhead = h
1.
2.
Minimize E[TRR] upper bound from Theorem:
Common case:
13
30
Mean response time
25
20
15
10
h=0
5
0
0
0.5
1
1.5
2
2.5
service quantum (q)
Job size distribution: H2 (balanced means)
E[S] = 1,
C2 =
19,  = 0.8
14
30
approximation q*
optimum q
Mean response time
25
20
15
1%
10
h=0
5
0
0
0.5
1
1.5
2
2.5
service quantum (q)
Job size distribution: H2 (balanced means)
E[S] = 1,
C2 =
19,  = 0.8
15
30
approximation q*
optimum q
Mean response time
25
20
15
2.5%
1%
10
h=0
5
0
0
0.5
1
1.5
2
2.5
service quantum (q)
Job size distribution: H2 (balanced means)
E[S] = 1,
C2 =
19,  = 0.8
16
30
approximation q*
optimum q
Mean response time
25
20
15
5%
2.5%
1%
10
h=0
5
0
0
0.5
1
1.5
2
2.5
service quantum (q)
Job size distribution: H2 (balanced means)
E[S] = 1,
C2 =
19,  = 0.8
17
30
approximation q*
optimum q
Mean response time
25
20
7.5%
15
5%
2.5%
1%
10
h=0
5
0
0
0.5
1
1.5
2
2.5
service quantum (q)
Job size distribution: H2 (balanced means)
E[S] = 1,
C2 =
19,  = 0.8
18
30
approximation q*
optimum q
Mean response time
25
10%
20
7.5%
15
5%
2.5%
1%
10
h=0
5
0
0
0.5
1
1.5
2
2.5
service quantum (q)
Job size distribution: H2 (balanced means)
E[S] = 1,
C2 =
19,  = 0.8
19
Outline
 Effect of q and C2 on mean response time
 Approximate analysis
 Bounds for M/G/1/RR
 Choosing the optimal quantum size
20
Conclusion/Contributions
• Simple approximation and bounds for
M/G/1/RR
• Optimal quantum size for handling highly
variable job sizes under preemption
overheads
q
Bounds – Proof outline
• Di = mean delay for ith quantum of service
• D = [D1 D2 ... DK]
• D is the fixed point of a monotone linear system:
DT = APDT+b
f1=0
f2=0
D2
Sufficient condition
for lower bound:
D’
D*
D’T  APD’T+b
for all P
Sufficient condition
for upper bound:
D*T  APD*T+b
for all P
D
D1
22
Optimizing q
• Preemption overhead = h
• q’ = q+h, E[S]’ → E[S] (1+h/q), ’ =  E[S]’
•
Heavy traffic:
Small overhead:
23