Queueing Theory (Part 4) - University of...

18
Queueing Theory-1 Queueing Theory (Part 4) Nonexponential Queueing Systems and Economic Analysis

Transcript of Queueing Theory (Part 4) - University of...

Page 1: Queueing Theory (Part 4) - University of Washingtoncourses.washington.edu/inde411/QueueingTheoryPart4.pdf · for their duration, the total service time will have an Erlang distribution.

Queueing Theory-1

Queueing Theory (Part 4)

Nonexponential Queueing Systems and Economic Analysis

Page 2: Queueing Theory (Part 4) - University of Washingtoncourses.washington.edu/inde411/QueueingTheoryPart4.pdf · for their duration, the total service time will have an Erlang distribution.

Queueing Theory-2

Queueing Models with Nonexponential Distributions

•  M/G/1 Model –  Poisson input process, general service time distribution with mean 1/µ

and variance σ2 –  Assume ρ = λ/µ < 1 –  Results

!"= 10P

µ+=

!=

/1

/

q

qq

WW

LW

q

q

LL

L

+=

!

+=

"

""#$)1(2

222

Notice for M/M/1:

!

P0 =1" #

Lq =

$2

µ2 + #2

2 1" #( )=

2#2

2 1" #( )=

#2

1" #

L = # + Lq = # +#2

1" #=

#1" #

Mean service time = 1/µ Variance of service time, σ2 = 1/µ2

Page 3: Queueing Theory (Part 4) - University of Washingtoncourses.washington.edu/inde411/QueueingTheoryPart4.pdf · for their duration, the total service time will have an Erlang distribution.

Queueing Theory-3

Queueing Models with Nonexponential Distributions

•  M/D/1 Model –  Poisson input process, deterministic service time distribution with

mean 1/µ and variance σ2=0

–  Assume ρ = λ/µ < 1

Lq =! 2" 2 + # 2

2(1! #)=0+ # 2

2(1! #)=

# 2

2(1! #)L = # + Lq

Page 4: Queueing Theory (Part 4) - University of Washingtoncourses.washington.edu/inde411/QueueingTheoryPart4.pdf · for their duration, the total service time will have an Erlang distribution.

M/D/s: L versus ρ for several values of s

Queueing Theory-4

17.7 QUEUEING MODELS INVOLVING NONEXPONENTIAL DISTRIBUTIONS 793

Thus, k is the parameter that specifies the degree of variability of the service times rela-tive to the mean. It usually is referred to as the shape parameter.

The Erlang distribution is a very important distribution in queueing theory for tworeasons. To describe the first one, suppose that T1, T2, . . . , Tk are k independent randomvariables with an identical exponential distribution whose mean is 1/(k!). Then their sum

T ! T1 " T2 " ### " Tk

has an Erlang distribution with parameters ! and k. The discussion of the exponential dis-tribution in Sec. 17.4 suggested that the time required to perform certain kinds of tasksmight well have an exponential distribution. However, the total service required by a cus-tomer may involve the server’s performing not just one specific task but a sequence of ktasks. If the respective tasks have an independent and identical exponential distributionfor their duration, the total service time will have an Erlang distribution. This will be thecase, e.g., if the server must perform the same exponential task k independent times foreach customer.

The Erlang distribution also is very useful because it is a large (two-parameter) fam-ily of distributions permitting only nonnegative values. Hence, empirical service-time dis-tributions can usually be reasonably approximated by an Erlang distribution. In fact, both

Utilization factor

0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1.00.1

1.0

10

100

L

$ ! %s&

s ! 1

s ! 7

s ! 5

s ! 4

s ! 3

s ! 2

s ! 10s !

15s !

20s !

25

Stea

dy-s

tate

exp

ecte

d nu

mbe

r of c

usto

mer

s in

the

queu

eing

sys

tem

! FIGURE 17.8Values of L for the M/D/smodel (Sec. 17.7).

hil76299_ch17_759-827.qxd 11/4/08 12:07 PM Page 793

Page 5: Queueing Theory (Part 4) - University of Washingtoncourses.washington.edu/inde411/QueueingTheoryPart4.pdf · for their duration, the total service time will have an Erlang distribution.

Queueing Theory-5

Queueing Models with Nonexponential Distributions

•  M/Ek/1 Model –  Erlang: Sum of exponentials

–  Think it would be useful? Yes, because service time may be made up of several tasks – each of which has an iid, independent identical exponential distribution, and T = T1 + T2 + T3 + … + TK

If Ti ~ expon(µ) and independent, then T~Erlang(k,µ) –  Can readily apply the formulae for M/G/1 where –  Also, Erlang k is between exponential and deterministic, and is a

2-parameter family so can get a better fit to more situations As k goes to infinity M/Ek/1 approaches M/D/1

! 2 =1/ kµ 2

!

fT (t) =µk( )k

k "1( )!t k"1e"kµt for t # 0

When k=1, get exponential

Erlang k as k --> ∞, approach deterministic

Mean

Standard Deviation

Variance !

!

!

!

!

1kµ

!

1kµ2

!

1µ2

!

" 0

!

" 0

Page 6: Queueing Theory (Part 4) - University of Washingtoncourses.washington.edu/inde411/QueueingTheoryPart4.pdf · for their duration, the total service time will have an Erlang distribution.

M/Ek/2: L versus ρ for several values of k

Queueing Theory-6

Models without a Poisson Input

All the queueing models presented thus far have assumed a Poisson input process (expo-nential interarrival times). However, this assumption is violated if the arrivals are sched-uled or regulated in some way that prevents them from occurring randomly, in which caseanother model is needed.

As long as the service times have an exponential distribution with a fixed parameter,three such models are readily available. These models are obtained by merely reversingthe assumed distributions of the interarrival and service times in the preceding three mod-els. Thus, the first new model (GI/M/s) imposes no restriction on what the interarrivaltime distribution can be. In this case, there are some steady-state results available15 (par-ticularly in regard to waiting-time distributions) for both the single-server and multiple-server versions of the model, but these results are not nearly as convenient as the simpleexpressions given for the M/G/1 model. The second new model (D/M/s) assumes that allinterarrival times equal some fixed constant, which would represent a queueing systemwhere arrivals are scheduled at regular intervals. The third new model (Ek /M/s) assumesan Erlang interarrival time distribution, which provides a middle ground between

17.7 QUEUEING MODELS INVOLVING NONEXPONENTIAL DISTRIBUTIONS 795

Utilization factor

0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1.00.1

1.0

10

100

L

! " #s$

k " 1

k " 2

k " 8

Stea

dy-s

tate

exp

ecte

d nu

mbe

r of c

usto

mer

s in

the

queu

eing

sys

tem

! FIGURE 17.10Values of L for the M/Ek /2model (Sec. 17.7).

15For example, see pp. 248–260 of Selected Reference 5.

hil76299_ch17_759-827.qxd 11/4/08 12:07 PM Page 795

Page 7: Queueing Theory (Part 4) - University of Washingtoncourses.washington.edu/inde411/QueueingTheoryPart4.pdf · for their duration, the total service time will have an Erlang distribution.

Queueing Theory-7

Application of Queueing Theory

•  We can use the results for the queueing models when making decisions on design and/or operations

•  Some decisions that we can address –  Number of servers –  Efficiency of the servers –  Number of queues –  Amount of waiting space in the queue –  Queueing disciplines

Page 8: Queueing Theory (Part 4) - University of Washingtoncourses.washington.edu/inde411/QueueingTheoryPart4.pdf · for their duration, the total service time will have an Erlang distribution.

Queueing Theory-8

Number of Servers •  Suppose we want to find the number of servers that minimizes the

expected total cost, E[TC] –  Expected Total Cost = Expected Service Cost + Expected Waiting Cost

(E[TC]= E[SC] + E[WC]) •  How do these costs change as the number of servers change?

Number of servers

Exp

ecte

d co

st

E[TC] E[SC] – increases with number of servers

E[WC] – decreases with number of servers

Minimum E[TC] is not necessarily where E[SC] and E[WC] intersect

Page 9: Queueing Theory (Part 4) - University of Washingtoncourses.washington.edu/inde411/QueueingTheoryPart4.pdf · for their duration, the total service time will have an Erlang distribution.

Queueing Theory-9

Repair Person Example

•  SimInc has 10 machines that break down frequently and 8 operators •  The time between breakdowns ~ Exponential, mean 20 days •  The time to repair a machine ~ Exponential, mean 2 days •  Currently SimInc employs 1 repair person and is considering hiring

a second •  Costs:

–  Each repair person costs $280/day –  Lost profit due to less than 8 operating machines:

$400/day for each machine that is down •  Objective: Minimize total cost •  Should SimInc hire the additional repair person?

Page 10: Queueing Theory (Part 4) - University of Washingtoncourses.washington.edu/inde411/QueueingTheoryPart4.pdf · for their duration, the total service time will have an Erlang distribution.

Queueing Theory-10

Repair Person Example Problem Parameters

•  What type of problem is this? –  M/M/1 ? –  M/M/s ? –  M/M/s/K ? –  M/M/s//N finite calling population ?

(close, but not exactly – have to draw the rate diagram finite number of machines (10), but maximum of 8 operating at a time)

–  M/G/1 ? –  M/Ek/1 ? –  M/D/1 ?

•  What are the values of λ and µ? Time between breakdowns ~expon. mean = 20 days λ = 1 customer / 20 days for each machine operating Compare 1 and 2 servers time to repair ~expon. mean = 2 days µ = 1 customer / 2 days

Page 11: Queueing Theory (Part 4) - University of Washingtoncourses.washington.edu/inde411/QueueingTheoryPart4.pdf · for their duration, the total service time will have an Erlang distribution.

Queueing Theory-11

Repair Person Example Rate Diagrams

•  Draw the rate diagram for the single-server and two-server case

Single server 0 1 2 3 4 …

•  Expected service cost (per day) = E[SC] = 1 server: 280 $/day 2 servers: 2(280) $/day = 560 $/day

•  Expected waiting cost (per day) = E[WC] =

10 9 8

Two servers 0 1 2 3 4 … 10 9 8

8λ 8λ 8λ 7λ 6λ 3λ 2λ λ

µ µ µ µ µ µ µ µ

!

400 1" P3 + 2P4 +!+ 8P10( ) = 400 n # 2( )Pnn= 3

10

$ = g n( )Pn$ where g n( ) =0 if n = 0,1,2

400 n # 2( ) if n = 3,4,…10% & '

µ 2µ 2µ 2µ 2µ 2µ 2µ 2µ

Page 12: Queueing Theory (Part 4) - University of Washingtoncourses.washington.edu/inde411/QueueingTheoryPart4.pdf · for their duration, the total service time will have an Erlang distribution.

Queueing Theory-12

Repair Person Example Steady-State Probabilities

•  Write the coefficients for the balance equations for each case Single server 2 servers

•  How to find E[WC] for s=1? s=2? !

C0 =1

C1 = 8 "µ

#

$ % &

' (

C2 = 82 "µ

#

$ % &

' (

2

C3 = 83 "µ

#

$ % &

' (

3

C4 = 83 ) 7 "µ

#

$ % &

' (

4

C5 = 83 ) 7 ) 6 "µ

#

$ % &

' (

5

= 82 ) 8!5!

#

$ % &

' (

5

!

C6 = 82 " 8!4!

$

% & '

( )

6

C7 = 82 " 8!3!

$

% & '

( )

7

C8 = 82 " 8!2!

$

% & '

( )

8

C9 = 82 " 8!1!

$

% & '

( )

9

C10 = 82 " 8!0!

$

% & '

( )

10

!

C0 =1

C1 = 8 "µ

#

$ % &

' (

C2 =82

2"µ

#

$ % &

' (

2

C3 =83

22"µ

#

$ % &

' (

3

C4 =83 ) 723

#

$ % &

' (

4

C5 =82

24)8!5!

#

$ % &

' (

5

!

!

E WC[ ] = 400 n " 2( )Pnn= 3

10

# = g n( )Pnn= 0

10

# where g n( ) =0 if n = 0,1,2

400 n " 2( ) if n = 3,4,…10$ % &

Page 13: Queueing Theory (Part 4) - University of Washingtoncourses.washington.edu/inde411/QueueingTheoryPart4.pdf · for their duration, the total service time will have an Erlang distribution.

Queueing Theory-13

Repair Person Example E[WC] Calculations

N=n g(n) s=1 s=2

Pn g(n) Pn Pn g(n) Pn 0 0 0.271 0 0.433 0 1 0 0.217 0 0.346 0 2 0 0.173 0 0.139 0 3 400 0.139 56 0.055 24 4 800 0.097 78 0.019 16 5 1200 0.058 70 0.006 8 6 1600 0.029 46 0.001 0 7 2000 0.012 24 0.0003 0 8 2400 0.003 7 0.00004 0

9 2800 0.0007 0 0.000004 0

10 3200 0.00007 0 0.0000002 0 E[WC] $281/day $48/day

Page 14: Queueing Theory (Part 4) - University of Washingtoncourses.washington.edu/inde411/QueueingTheoryPart4.pdf · for their duration, the total service time will have an Erlang distribution.

Queueing Theory-14

Repair Person Example Results

•  We get the following results

s E[SC]: E[WC]: E[TC]: 1 $280/day $281/day $561/day 2 $560/day $48/day $608/day ≥ 3 ≥ $840/day ≥ $0/day ≥ $840/day

•  What should SimInc do? Stay with 1 server Could consider other possibilities to reduce E[TC]; - instead of another server, decrease service time by considering faster equipment or an apprentice - consider a different maintenance policy to decrease arrival rate

* min!

Page 15: Queueing Theory (Part 4) - University of Washingtoncourses.washington.edu/inde411/QueueingTheoryPart4.pdf · for their duration, the total service time will have an Erlang distribution.

Queueing Theory-15

Supercomputer Example

•  Emerald University has plans to lease a supercomputer •  They have two options

•  Students and faculty jobs are submitted on average of 20 jobs/day, (λ = 20 jobs /day) distributed Poisson i.e. Time between submissions ~ 1/20 = 0.05 day = 1.2 hours

•  Which computer should Emerald University lease?

Supercomputer Mean number of jobs per day Cost per day

MBI 30 jobs/day $5,000/day

CRAB 25 jobs/day $3,750/day

µMBI = 30 jobs/ day

µCRAB = 25 jobs/ day

Page 16: Queueing Theory (Part 4) - University of Washingtoncourses.washington.edu/inde411/QueueingTheoryPart4.pdf · for their duration, the total service time will have an Erlang distribution.

Queueing Theory-16

Supercomputer Example

•  E[TC] = E[SC] + E[WC] •  Expected service cost:

•  Consider two forms for waiting costs (ω = waiting time in days): •  If waiting cost is linear:

h(ω)=cω then E[h(ω)] = cE[ω] = cW $/job and then E[WC] = cWλ = cL

•  If waiting cost is not linear: h(ω) = 500 ω + 400 ω 2

then E[h(ω)] is more difficult to express

E SC[ ] =5000 $/day for MBI 3750 $/day for CRAB

!"#

$#

$/job job/day $/day

Page 17: Queueing Theory (Part 4) - University of Washingtoncourses.washington.edu/inde411/QueueingTheoryPart4.pdf · for their duration, the total service time will have an Erlang distribution.

Queueing Theory-17

Supercomputer Example Waiting Cost Function

•  Assume the waiting cost is not linear: h(ω) = 500 ω + 400 ω 2 (ω = waiting time in days)

•  What distribution do the waiting times follow? •  What is the expected waiting cost, E[WC]?

!

for M/M/1 fw (") = µ 1# $( )e#µ 1#$( )"

!

E h "( )[ ] = 500" + 400" 2( )µ 1# $( )e#µ 1#$( )"d"0

%

&

=58 $/job for MBI 132 $/job for CRAB' ( )

E[WC] = E[h(")]* =1160 $/day for MBI 2640 $/day for CRAB' ( )

$/day $/job jobs/day

Page 18: Queueing Theory (Part 4) - University of Washingtoncourses.washington.edu/inde411/QueueingTheoryPart4.pdf · for their duration, the total service time will have an Erlang distribution.

Queueing Theory-18

Supercomputer Example Results

•  Next incorporate the leasing cost to determine the expected total cost, E[TC]

•  Which computer should the university lease?

MBI !

E TC[ ] = E SC[ ] + E WC[ ]

E TC[ ] =5000 $/day + 1160 $/day = 6160 $/day for MBI *3750 $/day + 2640 $/day = 6390 $/day for CRAB" # $