12
Queueing Theory-1 Queueing Theory (Part 2) M/M/1 Queueing System

Queueing Theory (Part 2)

  • Upload
    others

  • View
    7

  • Download
    0

Embed Size (px)

Citation preview

Page 1: Queueing Theory (Part 2)

Queueing Theory-1

Queueing Theory (Part 2)

M/M/1 Queueing System

Page 2: Queueing Theory (Part 2)

Queueing Theory-2

M/M/1 Queueing System •  Simplest queueing system •  Assumptions:

–  Interarrival times are iid, and exponentially distributed. The arrival process is Poisson.

–  Service times are iid, and exponentially distributed. –  There is one server

•  The interarrival times are exponentially distributed with parameter, ! = mean arrival rate

•  The service times are exponentially distributed with parameter, µ = mean service rate

•  The utilization is " = ! / µ

Page 3: Queueing Theory (Part 2)

Queueing Theory-3

M/M/1 Queueing System and Rate Diagram •  The number of customers in the system, N(t), in an M/M/1

queueing system satisfies the assumptions of a birth-death process with –  !n= ! for all n=0,1,2,! –  µn= µ for all n=0,1,2,!

•  We require ! < µ , that is " < 1 in order to have a steady state –  Why?

If ""1, won’t converge, and the queue will explode (up to +#)

Rate Diagram

0 1 2 3 4 !

! ! ! ! !

µ µ µ µ µ

Pn n=0

!

"

Page 4: Queueing Theory (Part 2)

Queueing Theory-4

M/M/1 Queueing System Steady-State Probabilities

Calculate Pn, n = 0, 1, 2, ! Rate In = Rate Out

!

State 0 : µP1 = "P0 # P1 ="µP0

State 1: "P0 + µP2 = " + µ( )P1 # P2 =1µ

" + µ( ) "µP0 $

µµ"P0

%

& '

(

) * =

"2

µ2 P0

State n : Pn =""!"µµ!µ

P0 ="µ

%

& ' (

) *

n

P0 = +nP0

Need Pnn= 0

,

- =1

%

& ' (

) *

n

P0 = P0"µ

%

& ' (

) *

n

=n= 0

,

-n= 0

,

- P0 +n =n= 0

,

- P01

1$ +%

& '

(

) * =1

!

Geometric Series

"n =n= 0

#

$ 11% "

if " <1

!

For M/M/1 with " <1P0 =1# "Pn = "n 1# "( ) for n = 0,1,2,…

Page 5: Queueing Theory (Part 2)

Queueing Theory-5

M/M/1 Queueing System L, Lq, W, Wq

Calculate L, Lq, W, Wq

!

L = expected number in system = nPnn= 0

"

# = n$n 1% $( )n= 0

"

# = $ 1% $( ) n$n%1

n= 0

"

#

L = $ 1% $( ) d$n

d$n= 0

"

# = $ 1% $( ) dd$

$n

n= 0

"

# = $ 1% $( )d 1

1% $&

' (

)

* +

d$=$ 1% $( )1% $( )2 =

$1% $

=, /µ

1% , /µ=

,µ % ,

Lq = expected number in queue = n %1( )Pnn=1

"

# = n %1( )$n

n=1

"

# 1% $( ) = n$n

n=1

"

# 1% $( ) % $n

n=1

"

# 1% $( )

Lq = L % 1% P0( ) = L % $ =$

1% $% $ =

$2

1% $=

,2

µ µ % ,( )

W =L,

=,

µ % ,( ),=

1µ % ,( )

Wq =Lq,

=,2

µ µ % ,( ),=

,µ µ % ,( )

!

d"n

d"= n"n#1

!

d 1" #( )"1

d#= "1 1" #( )"2 "1( )

d 1" #( )"1

d#=

11" #( )2

Page 6: Queueing Theory (Part 2)

Queueing Theory-6

M/M/1 Queueing System Distribution of Time in System

! =waiting time in systemExpected waiting time in system:

W = E ![ ] = 1µ !"

Probability that waiting time in system exceeds t :P ! > t( ) = e!µ 1!#( )t for t " 0

!q=waiting time in queueExpected waiting time in queue:

Wq = E !q#$ %&=

"µ µ !"( )

Probability that waiting time in queue exceeds t :P !q > t( ) = #P !q > t( ) = #e!µ 1!#( )t for t " 0

Page 7: Queueing Theory (Part 2)

Queueing Theory-7

M/M/1 Example: ER •  Emergency cases arrive independently at random •  Assume arrivals follow a Poisson input process (exponential

interarrival times) and that the time spent with the ER doctor is exponentially distributed

•  Average arrival rate = 1 patient every $ hour != 2 patients / hour

•  Average service time = 20 minutes to treat each patient

µ= 1 patient / 20 minutes = 3 patients / hour •  Utilization

" = %/µ=2/3

•  Does this M/M/1 queue reach steady state? Yes! "<1

Page 8: Queueing Theory (Part 2)

Queueing Theory-8

M/M/1 Example: ER Questions

In steady state, what is the! 1. probability that the doctor is idle?

2. probability that there are n patients?

3. expected number of patients in the ER?

4. expected number of patients waiting for the doctor?

Page 9: Queueing Theory (Part 2)

Queueing Theory-10

M/M/1 Example: ER Questions In steady state, what is the!

5. expected time in the ER?

6. expected waiting time?

7. probability that there are at least two patients waiting to see the doctor?

8. probability that a patient waits to see the doctor more than 30 minutes?

Page 10: Queueing Theory (Part 2)

Queueing Theory-12

Car Wash Example •  Consider the following 3 car washes •  Suppose cars arrive according to a Poisson input process and

service follows an exponential distribution •  Fill in the following table What conclusions can you draw from your results?

! µ ! L Lq W Wq P0

Car Wash A 0.1 car/min

0.5 car/min

Car Wash B 0.1 car/min

0.11 car/min

Car Wash C 0.1 car/min

0.1 car/min

Page 11: Queueing Theory (Part 2)

Queueing Theory-13

Car Wash Example •  Consider the following 3 car washes •  Suppose cars arrive according to a Poisson input process and

service follows an exponential distribution •  Fill in the following table What conclusions can you draw from your results? As & ! 1, then L, Lq, W, Wq ! # and P0 ! 0

! µ ! L Lq W Wq P0

Car Wash A 0.1 car/min

0.5 car/min

0.1/0.5 = 0.2

(0.1)/(0.5-0.1) = 0.25

(0.1)2/(0.5)(0.4) = 0.05

0.25/0.1 = 2.5 min

0.5/0.1 = 0.5 min

0.4/0.5 = 0.8

Car Wash B 0.1 car/min

0.11 car/min

0.1/1.1 = 0.909

(0.1)/(0.11-0.1) = 10

(0.1)2/(0.11)(0.1) = 9.09

10/0.1 = 100 min

9.09/0.1 = 90.9 min

0.01/11 = 0.09

Car Wash C 0.1 car/min

0.1 car/min

0.1/0.1 = 1

0.1/(0.1-0.1) = +#

Not steady state +# +# +# 0/0.1 = 0

Page 12: Queueing Theory (Part 2)

!"

#!"

$!"

%!"

&!"

'!"

(!"

)!"

*!"

+!"

#!!"

!,!!" !,#!" !,$!" !,%!" !,&!" !,'!" !,(!" !,)!" !,*!" !,+!" #,!!"

Queueing Theory-14

Car Wash Example •  M/M/1 with %=0.1 car/min •  &=%/µ •  L=%/(µ-%) = &/(1-&)

L

& Rule of thumb: never exceed & = 0.8, 80% utilization

Car wash A Car wash B