Professional Documents
Culture Documents
Queuing Theory
Server
Rear of Front of
queue queue
Server
Server
Pool of potential
customers List of servers able to
service the customers
Queuing Theory -- cont.
P ( t ) 1 e lt
y
y=1
P( t) = P ( t ) 1 e lt
Probability of for small l
an arbitrary P ( t ) 1 e lt
interarrival time
being less than t for large l
t=0
t (time)
Example:
arrival rate: one every two minutes
The rate of one customer every two
minutes l = 0.5 customers per minute
t P(t)
P ( t ) 1 e lt 1 e . 5t -------------------------------------
0 0
1 .393
2 .632
The probability function does not tell 3 .777
us when customers will arrive. 4 .865
It does, however, provide information 5 .918
about the random arrival process. .. ..
10 .993
.. ..
20 .99995
Total # of customers in
the queueing system
N
Server 1
# of customers Ns
Average in the queue # of customers
arrival rate in service
Nq
l
q
Service time
interarrival Time spent
time in the queue S
Server C
W
Total time a customer spends
in the queueing system
• The probability that exactly n customers will
arrive in any time interval of length t is
e lt ( lt ) n
( n 0, 1, 2)
n!
u = 17/5 = 3.4
need at least 4 servers
Case Studies
A shared Laser printer
• An average of 64 requests occurring at
random times during eight-hour day.
• Each request require an average of about 5
minutes to print.
• Receiving compaints from employees that
they must wait nearly half an hour for their
printout.
8 requests/hour
l = 2/15 requests/minute
12 requests/hour
m = 1/ 5 request/minute
Server Utilization
• Server utilization r is defined as the traffic
intensity per server
u l
r r 2/3
c mc
• is the probability that a particular server is
busy
• this is approximately the fraction of time that
each server is in use
• For single-server system, u = r
Probability of All Server Idle
c 1
li lc
p0 [ ]1
i 0 i !* m i
c !* m c
*( 1 r )
When c= 1
p0 1 r (1 - 2/3 = 1/3)
Probability of All Server Busy
• Erlang’s C Formula:
p0 lc
C ( c , l /m )
c ! m c ( 1 r )
When c = 1
C ( c , l /m ) r (2/3)
Expected Number of Customers
L q rC ( c , l / m )/( 1 r )
When c = 1
2
r (2/3)2/(12/3)4/3
Lq
1 r
Expected Wait Time
• Little’s Formula
Wq C ( c , l / m )/[ m c ( 1 r )]
When c = 1
r /m [(2/3)/0.2]/(1-2/3)
Wq
1 r
= 10 minutes
90th Percentile Wait Time
When c = 1
ln( 10 r )
q ( 90 ) ln(10*2/3)/(1/5 - 2/15)
ml = 28.4 minutes
Case Study 2
Master Scheduler
• Computer running simulation programs
requires a lot of CPU time and scheduled on a
FIFO basis.
• Generally submit about 100 programs per day
• The programs require an average of about
one hour of CPU time.
100 requests/day
l = 100/24 = 4.2 requests/hour
1 requests/hour
m = 1 request/hour
Example 1
• The election of the President of
Student Association(學生會)is P0 1 r
just finished in Tamkang C (c, l / m ) r
University. There are 27,000
students and the average rate of r2
voting is 15%. The official voting Lq
1 r
period was 5 days, from 8:00 to
17:00. The association prepared r
only one counter for everyone to m
Wq
vote and each voting requires half 1 r
minute to complete. Use the
equation provided to analyze the ln( 10 * r )
q (90)
condition of student getting in-line m l
and wait for the voting. You must
explain the meaning of each
equation. (ln(2.5)=0.9, ln(7.5)=2,
ln(15)=2.7)
Example 2
• There are 36 programmers P0 1 r
per day, in average, come in to C (c, l / m ) r
use the mainframe computer
r2
in the computing center. Each Lq
1 r
programmer uses the
computer for about 15 r
m
minutes. Use the equation Wq
1 r
provided to analyze the usage
of the computer. You must ln( 10 * r )
q (90)
explain the meaning of each m l
equation.