Queueing Models: Discrete-Event System Simulation
Queueing Models: Discrete-Event System Simulation
Queueing Models
3
Characteristics of Queueing Systems
Key elements of queueing systems:
Customer: refers to anything that arrives at a facility and requires
service, e.g., people, machines, trucks, emails.
Server: refers to any resource that provides the requested
service, e.g., repairpersons, retrieval machines, runways at
airport.
4
1. Calling Population
[Characteristics of Queueing System]
5
2. System Capacity
[Characteristics of Queueing System]
6
3. Arrival Process
[Characteristics of Queueing System]
8
4. Queue Behavior and Queue Discipline
[Characteristics of Queueing System]
Queue behavior: the actions of customers while in a queue
waiting for service to begin, for example:
Balk: leave when they see that the line is too long,
Renege: leave after being in the line when its moving too slowly,
Jockey: move from one line to a shorter line.
9
5. Service Times and Service Mechanism
[Characteristics of Queueing System]
Service times of successive arrivals are denoted by S1,
S2, S3.
May be constant or random.
{S1, S2, S3, …} is usually characterized as a sequence of
independent and identically distributed random variables, e.g.,
exponential, Weibull, gamma, lognormal, and truncated normal
distribution.
A queueing system consists of a number of service
centers and interconnected queues.
Each service center consists of some number of servers, c,
working in parallel, upon getting to the head of the line, a
customer takes the 1st available server.
10
Service Times and Service Mechanism
[Characteristics of Queueing System]
11
Service Times and Service Mechanism
[Characteristics of Queueing System]
Wait for one of the three clerks:
13
Computer Science,
Informatik 4 Communication and
Distributed Systems
Chapter 8. Queueing
Models Dr. Mesut Güneş 14
Queueing Notation
[Characteristics of Queueing System]
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.
15
Computer Science,
Informatik 4 Communication and
Distributed Systems
Chapter 8. Queueing
Models Dr. Mesut Güneş 16
17
Computer Science,
Informatik 4 Communication and
Distributed Systems
Number
of customers in
the
system
Tim
e
Chapter 8. Queueing
Models Dr. Mesut Güneş 18
Time-Average Number in System L
[Characteristics of Queueing System]
19
Time-Average Number in System L
[Characteristics of Queueing System]
The time-weighted-average number in queue is:
1 1 T
ˆ
LQ
T i 0
Q
iTi
T 0
LQ (t )dt LQ as T
0, if L(t) 0
LQ (t )
L(t ) 1, if L(t) 1
0(15) 1( 4) 2(1)
LˆQ 0.3 customers
20
20
Average Time Spent in System Per
Customer w [Characteristics of Queueing System]
where W1, W2, …, WN are the individual times that each of the N
customers spend in the system during [0,T].
For stable systems: w ˆ w as N
If the system under consideration is the queue alone:
1 N Q
wˆ Q Wi wQ as N
N i 1
G/G/1/N/K example (cont.): the average system time is
W1 W2 ... W5 2 (8 3) ... (20 16)
wˆ 4.6 time units
5 5
21
The Conservation Equation
[Characteristics of Queueing System]
Average # in
Lˆ ˆwˆ Average
system System time
Arrival rate
L w as T and N
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.
22
Server Utilization
[Characteristics of Queueing System]
23
Server Utilization
[Characteristics of Queueing System]
24
Server Utilization
[Characteristics of Queueing System]
In general, for a single-server queue:
Lˆ s ˆ Ls as T
and E ( s )
For a single-server stable queue: 1
25
Server Utilization
[Characteristics of Queueing System]
26
Computer Science,
Informatik 4 Communication and
Distributed Systems
Chapter 8. Queueing
Models Dr. Mesut Güneş 27
Server Utilization and System Performance
[Characteristics of Queueing System]
28
Computer Science,
Performance
i ⎨
• The occurrence of a
relatively long service
time (S2 = 12) causes a
waiting line to form
temporarily.
Chapter 8. Queueing
Models Dr. Mesut Güneş 29
Server Utilization and System Performance
[Characteristics of Queueing System]
Example: A physician who schedules patients every 10 minutes and
spends Si minutes with the ith patient: 9 minutes with probability 0.9
Si
12 minutes with probability 0.1
Arrivals are deterministic, A1 = A2 = … = -1 = 10.
Services are stochastic, E(Si) = 9.3 min and V(S0) = 0.81 min2.
On average, the physician's utilization = = 0.93 < 1.
Consider the system is simulated with service times: S1 = 9, S2 = 12,
S3 = 9, S4 = 9, S5 = 9, …. The system becomes:
31
Steady-State Behavior of Infinite-Population
Markovian Models M/M/C or M/G/C
Markovian models: exponential-distribution arrival process
(mean arrival rate = ).
Service times may be exponentially distributed as well (M) or
arbitrary (G).
A queueing system is in statistical equilibrium if the probability
that the system is in a given state is not time dependent:
P( L(t) = n ) = Pn(t) = Pn.
Mathematical models in this chapter can be used to obtain
approximate results even when the model assumptions do not
strictly hold (as a rough guide).
Simulation can be used for more refined analysis (more faithful
representation for complex systems).
32
Steady-State Behavior of Infinite-Population
Markovian Models
For the simple model studied in this chapter, the steady-state
parameter, L, the time-average number of customers in the system
is:
L
nPn
n 0
Apply Little’s equation to the whole system and to the queue alone:
L=W*lamda
L 1
w , wQ w
LQ wQ
33
M/G/1 Queues [Steady-State of Markovian Model]
/ , P0 1
2 (1 2 2 ) 2 (1 2 2 )
L , LQ
2(1 ) 2(1 )
1 (1 / 2 2 ) (1 / 2 2 )
w , wQ
2(1 ) 2(1 )
34
M/G/1 Queues [Steady-State of Markovian Model]
35
M/G/2 Queues [Steady-State of Markovian Model]
(1 / 30) 2 [ 24 2 400]
LQ 2.711 customers
2(1 4 / 5)
The proportion of arrivals who find Able idle and thus experience no delay is P0
= 1- = 1/5 = 20%.
Baker: 1/ = 25 minutes and 2 = 22 = 4 minutes2:
(1 / 30) 2 [25 2 4]
LQ 2.097 customers
2(1 5 / 6)
The proportion of arrivals who find Baker idle and thus experience no delay is
P0 = 1- = 1/6 = 16.7%.
Although working faster on average, Able’s greater service variability
results in an average queue length about 30% greater than Baker’s.
36
M/M/1 Queues [Steady-State of Markovian Model]
/ , Pn 1 n
2 2
L , LQ
1 1
1 1
w , wQ
(1 ) (1 )
37
M/M/1 Queues [Steady-State of Markovian Model]
38
Computer Science,
Informatik 4 Communication and
Distributed Systems
M/M/1
Queues
Chapter 8. Queueing
Models Dr. Mesut Güneş 39
Effect of Utilization and Service Variability
[Steady-State of Markovian Model]
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) 2
E ( X ) 2
The larger cv is, the more variable is the distribution relative to its
expected value
40
Effect of Utilization and Service Variability
[Steady-State of Markovian Model]
Consider LQ for any M/G/1
queue:
2 (1 2 2 )
LQ
2(1 )
2 1 (cv) 2
1 2
41
Multiserver Queue [Steady-State of Markovian Model]
43
Steady-State Behavior of Finite-Population
Models
When the calling population is small, the presence of one or
more customers in the system has a strong effect on the
distribution of future arrivals.
Consider a finite-calling population model with K customers
(M/M/c/K/K):
The time between the end of one service visit and the next call for
service is exponentially distributed, (mean = 1/).
Service times are also exponentially distributed.
c parallel servers and system capacity is K.
44
Steady-State Behavior of Finite-Population
Models
Some of the steady-state probabilities:
1
c 1 K n K K!
n
P0
n 0 n n c
( K n )! c! c nc
K n
P0 , n 0,1,..., c 1
n
Pn n
K!
( K n)!c!c n c , n c, c 1,...K
K
L nP ,
n 0
n w L / e , e / c
where e is the long run effective arrival rate of customers to queue (or entering/exiting service)
K
e ( K n )P
n 0
n
45
Steady-State Behavior of Finite-Population
Models
Example: two workers who are responsible for10 milling
machines.
Machines run on the average for 20 minutes, then require an
average 5-minute service period, both times exponentially
distributed: = 1/20 and = 1/5.
All of the performance measures depend on P0:
1
2 1 10 5 n 10 10! 5
n
P0
n 0 n 20 n 2 (10 n)!2!2
n2
20
0.065
47
Networks of Queues
The overall arrival rate into queue j:
j aj p
all i
i ij
If queue j has cj < ∞ parallel servers, each working at rate j, then
the long-run utilization of each server is j=j/(cj) (where j < 1
for stable queue).
If arrivals from outside the network form a Poisson process with
rate aj for each queue j, and if there are cj identical servers
delivering exponentially distributed service times with mean 1/j,
then, in steady state, queue j behaves likes an M/M/cj queue with
arrival rate j a j
i pij
all i
48
Network of Queues
Discount store example:
Suppose customers arrive at the rate 80 per hour and 40%
choose self-service. Hence:
Arrival rate to service center 1 is 1 = 80(0.4) = 32 per hour
Arrival rate to service center 2 is 2 = 80(0.6) = 48 per hour.
c2 = 3 clerks and 2 = 20 customers per hour.
The long-run utilization of the clerks is:
2 = 48/(3*20) = 0.8
All customers must see the cashier at service center 3, the
overall rate to service center 3 is 3 = 1 + 2 = 80 per hour.
If 3 = 90 per hour, then the utilization of the cashier is:
3 = 80/90 = 0.89
49
Summary
Introduced basic concepts of queueing models.
Show how simulation, and some times mathematical analysis, can
be used to estimate the performance measures of a system.
Commonly used performance measures: L, LQ, w, wQ, , and e.
When simulating any system that evolves over time, analyst must
decide whether to study transient behavior or steady-state behavior.
Simple formulas exist for the steady-state behavior of some queues.
Simple models can be solved mathematically, and can be useful in
providing a rough estimate of a performance measure.
50