Professional Documents
Culture Documents
to be used in Simulation
Radu Trmbitas
UBB
Queueing Models
1 / 41
Purpose
Simulation is often used in the analysis of queueing models
A simple but typical queueing model:
Queueing Models
2 / 41
Outline
Queueing Models
3 / 41
Outline
Queueing Models
3 / 41
Outline
Queueing Models
3 / 41
Outline
Queueing Models
3 / 41
Outline
Queueing Models
3 / 41
Queueing Models
4 / 41
Calling Population
Queueing Models
5 / 41
System Capacity
Queueing Models
6 / 41
Queueing Models
7 / 41
Queueing Models
8 / 41
Queueing Models
9 / 41
Queueing Models
10 / 41
Queueing Models
11 / 41
Queueing Models
12 / 41
Queueing notation I
Queueing Models
13 / 41
Queueing notation II
Primary performance measures of queueing systems:
Pn : steady-state probability of having n customers in system,
Pn (t ): probability of n customers in system at time t,
: arrival rate,
e : effective arrival rate,
: service rate of one server,
: server utilization,
An : interarrival time between customers n 1 and n,
Sn : service time of the nth arriving customer,
Wn : total time spent in system by the nth arriving customer,
WnQ : total time spent in the waiting line by customer n,
L(t ): the number of customers in system at time t,
LQ (t ): the number of customers in queue at time t,
L: long-run time-average number of customers in system,
LQ : long-run time-average number of customers in queue,
w : long-run average time spent in system per customer,
wQ : long-run average time spent in queue per customer.
Radu Trmbitas (UBB)
Queueing Models
14 / 41
iTi =
i =1
1
T
Z T
L(t )dt
Z T
0
L(t )dt L as T
Queueing Models
15 / 41
iTiQ =
i =0
1
T
Z T
0
LQ (t )dt LQ
as T
b
L = (0 3 + 1 12 + 2 4 + 3 1) /20
= 1.15 customers
0,
L(t ) = 0
LQ (t ) =
L(t ) 1, L(t ) 1
0 15 + 1 4 + 2 1
LQ (t ) =
= 0.3 customers
20
Radu Trmbitas (UBB)
Queueing Models
16 / 41
1
N
WiQ wQ
as N
i =1
2 + (8 3) + + (20 16)
5i =1 Wi
=
= 4.6 time units
5
5
Queueing Models
17 / 41
L = w as T and N
where b
L average # in system, b
arrival rate, w
b average system time
Holds for almost all queueing systems or subsystems (regardless of the
number of servers, the queue discipline, or other special
circumstances).
G /G /1/N/K example (cont.): On average, one arrival every 4 time
units and each arrival spends 4.6 time units in the system. Hence, at
an arbitrary point in time, there is (1/4)(4.6) = 1.15 customers
present on average.
Queueing Models
18 / 41
Server Utilization I
Definition: the proportion of time that a server is busy.
Observed server utilization, b, is defined over a specified time interval
[0, T ].
Long-run server utilization is .
For systems with long-run stability: b as T
Queueing Models
19 / 41
Server Utilization II
In general, for a single-server queue:
b
Ls = b Ls = as T
and
= E (s ) =
<1
<1
Queueing Models
20 / 41
Ls
=
, where < c for stable systems
c
c
Queueing Models
21 / 41
Queueing Models
22 / 41
Queueing Models
23 / 41
= $10 w
bQ = $10 b
LQ /hour
hour
customer
Queueing Models
24 / 41
Queueing Models
25 / 41
L=
nPn
n =0
Apply Littles equation to the whole system and to the queue alone:
w=
L
,
wQ = w
1
,
LQ = wQ
Queueing Models
26 / 41
M/G/1 Queues
P0 = 1
2 1 + 2 2
L = +
,
2 (1 )
1
2
+
1
2
w= +
,
2 (1 )
=
Queueing Models
2 1 + 2 2
LQ =
2 (1 )
1
2
+
2
wQ =
2 (1 )
27 / 41
M/G/1 Queues II
2
2 2
+
2 (1 ) 2 (1 )
Queueing Models
28 / 41
Queueing Models
29 / 41
M/M/1 Queues I
Suppose the service times in an M/G/1 queue are exponentially
distributed with mean 1 , then the variance is 2 = 12 .
M/M/1 queue is a useful approximate model when service times
have standard deviation approximately equal to their means.
The steady-state parameters:
=
Pn = ( 1 ) n
2
2
=
,
LQ =
=
1
( )
1
1
1
w=
=
,
wQ =
=
(1 )
( )
(1 )
L=
Queueing Models
30 / 41
M/M/1 Queues II
Example: M/M/1 queue with service rate = 10 customers per
hour.
Consider how L and w increase as arrival rate, , increases from 5 to
8.64 by increments of 20%:
If / 1, waiting lines tend to continually grow in length.
5
6
7.2
8.64
10
0.5 0.6
0.72 0.864 1.000
L 1
1.5
2.57 6.35
Queueing Models
31 / 41
For almost all queues, if lines are too long, they can be reduced by
decreasing server utilization () or by decreasing the service time
variability (2 ).
A measure of the variability of a distribution, coefficient of variation
(cv ):
V (X )
cv =
E (X )2
The larger cv is, the more variable is the distribution relative to its
expected value
Queueing Models
32 / 41
2 1 + 2 2
LQ =
2 (1 )
2
1 + (cv )2
=
2
(1 )
Queueing Models
33 / 41
Multiserver Queue
Queueing Models
34 / 41
Queueing Models
35 / 41
K!
P0 =
+
n c
n
(
K
n
)
!c!c
n =c
n =0
n
K
P0 ,
n = 0, 1, . . . , c 1
n
Pn =
n
K!
, n = c, c + 1, . . . , K
(K n)!c!c nc
"
c 1
L=
nPn ,
n =0
w=
L
,
e
e
c
e =
(K n) Pn
n =0
Radu Trmbitas (UBB)
Queueing Models
36 / 41
21
10
P0 =
n =0 n
n
n # 1
10
1
10!
1
+
= 0.0647
n
2
4
4
n=2 (10 n )!2!2
L=
n =0
Queueing Models
37 / 41
Networks of Queues I
Many systems are naturally modeled as networks of single queues:
customers departing from one queue may be routed to another.
The following results assume a stable system with infinite calling
population and no limit on system capacity:
Provided that no customers are created or destroyed in the queue, then
the departure rate out of a queue is the same as the arrival rate into
the queue (over the long run).
If customers arrive to queue i at rate i , and a fraction 0 pij 1 of
them are routed to queue j upon departure, then the arrival rate from
queue i to queue j is i pij (over the long run).
Queueing Models
38 / 41
Networks of Queues II
If queue j has cj < parallel servers, each working at rate j , then
Queueing Models
39 / 41
Queueing Models
40 / 41
Summary
Queueing Models
41 / 41