You are on page 1of 18

Basics of Queueing Theory

Material from Chapter 2 of Simio and Simulation:


Modeling, Analysis, Applications as well as
external sources
Introduction
Most (not all) simulations are of queueing systems, or networks
of queues, modeling real systems
Customers show up, wait for service, get served, maybe go
elsewhere, wait again, get served again, etc., maybe leave
Chapter 2 Basics of Queueing Theory 2
System Customers Servers
Manufacturing Parts Machines, people, transport
Urgent-care clinic Patients Doctors, nurses, other staff, rooms
Supply chain Parcels, loads, trucks Docks, warehouse space, trucks
Bank Customers Tellers, loan officers, drive-throughs
Amusement park Guests Rides, food stands, urgent-care clinic
Computer lab Students Computers, printers, help staff
Telecommunications Messages, packets Terminals, relays, switches
Traffic intersection Vehicles, pedestrians Segments of space in the intersection
A Single-Server Queueing System
Chapter 2 Basics of Queueing Theory 3
Registration
Queue
Reg. Desk
Arriving
patients
Departing
patients
Patient being
registered
Often interested in output performance measures (metrics), like
Total number of patients going from entry to exit over a fixed time period
Average time in queue (waiting time), not counting service time
Maximum time in queue
Time-average number of parts in queue (area under number-in-queue
function, divided by length of time period)
Maximum number of patients in queue over a fixed time period
Average patient time in system
Maximum patient time in system
Utilization of the server (proportion of time busy)
Could be a node in a larger queueing network

Interarrival times, service
times random (need to specify
probability distributions)
Urgent-Care Clinic
Chapter 2 Basics of Queueing Theory 4
Some questions:
How many staff of which type during which time periods?
How big should the waiting room(s) be?
What would be the effect on patient waits if doctors and nurses tended
to decrease or increase the time they spend with patients?
What if 10% more patients arrived (arrival rate increased by 10%)?
Should we serve patients in order of their acuity, or just first-in-first-out
(FIFO)?
Random arrivals (no
appointments)
Branching probabilities
(independent)
Why Study Queueing Theory with Simulation?
Chapter 2 Basics of Queueing Theory 5
Terminology, logic similar to many simulation models
In some cases, can derive exact closed-form formulas for output
performance metrics, use to verify (debug) simulation models:
Have simulation model of complex system that does not meet queueing-
theory assumptions but it would if we made some (over-)simplifying
extra assumptions like exponential distributions for inter-arrival and
service times
Modify the simulation model so that it meets these extra assumptions,
run it for a very long time queueing-theoretic results are typically
available only for steady state (a.k.a. long run, infinite horizon)
Compare simulation output with queueing-theoretic results if they
(approximately) agree, then confidence in the simulation is improved.
Restore your simulation model back the way it should be!

Entities (like customers, patients, jobs) arrive, get served either
at a single station or at several stations, may wait in queue(s),
and may leave the system (if they do, its an open system,
otherwise if they never leave its closed)
Queueing network could consist of several separate queueing
stations, each of which is a single- or multiple-server queue
If multiple server, usually assume that a single queue feeds all the
parallel servers, and that the servers are identical in service speeds:



Queue disciplines when an entity can leave the queue and
start service, which entity gets to be the next one to be served?
First-in, first-out (FIFO), a.k.a. first-come, first-served (FCFS)
Last-in, first-out (LIFO) a stack of physical or logical objects
Priority Shortest Job First (SJF); or Maximum Value First (MVF)
Queueing-System Structure and Terminology
Chapter 2 Basics of Queueing Theory 6
Queueing-System Performance Metrics
(W
q
) Time in queue (excluding service time); if in a network,
either overall (added up for all queueing waits) or at individual
stations
(W) Time in system, including time in queue plus service time
(again over the network or at a node)
(L
q
) Number of entities in queue (a.k.a. queue length), not
including any entities in service (again, over the network or at a
node)
(L) Number of entities in system, including in queue plus in
service (over network or at a node)
() Utilization of a server, or of a group of parallel identical
servers, the time-average number of individual servers in the
group who are busy
Chapter 2 Basics of Queueing Theory 7
Urgent Care Clinic
7/16/2014 Basics of Queueing Theory 8
Kelton et al., 2011, p. 21
Example Single-server Queueing System
7/16/2014 Basics of Queueing Theory 9
Registration
Queue
Reg. Desk
Arriving
patients
Departing
patients
Patient being
registered
Patient Arrival/Registration Time Data
Patient Arrival Time IAT ST
1 0 0 2
2 3 3 5
3 4 1 2
4 7 3 3
5 14 7 2
6 16 2 7
7 19 3 3
8 26 7 2
9 35 9 1
10 38 3 7
7/16/2014 Basics of Queueing Theory 10
7/16/2014 Basics of Queueing Theory 11
Queuing Systems
Common assumptions:
c servers with a single queue with FIFO ordering
A
1
, A
2
, , A
n
are IID random variables (interarrival times)
is the arrival rate
S
1
, S
2
, , S
n
are IID random variables (service times)
is the service rate
As and Ss are independent
= /c is the utilization
A/B/c/k queuing system (Kendalls notation)
M/M/1
M/M/c
M/G/c
GI/G/c
7/16/2014 Basics of Queueing Theory 12
Queuing Systems
Define the following performance measures:
W
qi
is the delay in the queue for the i
th
customer
W
i
= W
qi
+ S
i
is the waiting time in the system for the i
th
customer
L
q
(t) is the number of customers in the queue at time t
L(t) is the number of customers in the system at time t (L
q
(t) plus the
number being served at time t)

1
lim
=

=

n
qi
i
q
n
W
W
n
1
lim
=

=

n
i
i
n
W
W
n
Steady state average
delay in the queue
Steady state average
waiting time in the system
7/16/2014 Basics of Queueing Theory 14
M/M/c Queuing Formulae
( )
( )
( )
( )
( )
( )
( )
( )
( )

1
1
1
1
0
1
1
1
0
1
1
1 0
1
2
2
2
1
1
0
+

q
c
q
q
c
q
c
n
n c
w W
c c
p c
W
L L
c
p c
L
n
c
c
c
p
c M M M M
!
) (
!
) (
! !
) (
/ / / /
Askin, R. G. and C. R. Standridge,
Modeling and Analysis of
Manufacturing Systems, John Wiley &
Sons, New York, NY, 1993.
Queueing Networks
Consist of nodes, each of which is a G/G/c station, connected by
arcs representing possible entity travel between nodes
Can also have entity arrivals from outside the network, and entities can
exit from any node to outside the system
When an entity leaves a node, it can go out on any of the arcs
emanating from that node, with arc probabilities summing to 1
Assume:
All arrival processes from outside have
exponential interarrival times (a.k.a.
Poisson processes), and are independent
of each other
All service times are independent
exponential (so each node is an M/M/c)
All queue capacities are infinite
Utilization (a.k.a. traffic intensity)
locally at each node is < 1
Chapter 2 Basics of Queueing Theory 16
Called a Jackson network
with these assumptions;
much is known about it
Queueing Networks
7/16/2014 Basics of Queueing Theory 17
Kelton et al., 2011, p. 21
Queueing Networks (cont.)
Use all of this to analyze each node in a Jackson network as a
stand-alone M/M/c queue, using formulae given earlier
Just have to compute Poisson arrival input/output rates using
decomposition, superposition of Poisson processes
Let
SignIn
be the (Poisson) arrival rate into the Sign In station, assume
exponential service times throughout:
Chapter 2 Basics of Queueing Theory 18
Analyze each node independently as:
Sign In: M/M/2, arrival rate
SignIn

Registration: M/M/1, arrival rate 0.9
SignIn

Trauma Rooms: M/M/2, arrival rate 0.1
SignIn

Exam Rooms: M/M/4, arrival rate 0.9
SignIn

Treatment Rooms: M/M/2, arrival rate
(0.9)(0.6)
SignIn
+ 0.1
SignIn
= 0.64
SignIn

Queueing Network Example
7/16/2014 Basics of Queueing Theory 19
B
= 20/hr
ST
A
~ expo(1.875) min
A
C
ST
B
~ expo(4.0) min
ST
C
~ expo(6.667) min
60%
40%
Queueing Theory vs. Simulation
Queueing-theoretic results have the advantage of being exact,
i.e., no statistical uncertainty/variation
Simulation results have statistical uncertainty/variation, which needs to
be acknowledged and appropriately addressed
But queueing theory has its own shortcomings:
Strong assumptions that may be unrealistic, like exponential service
times (mode = 0?), making model validity questionable
Nearly always only for steady-state long-run behavior, so dont address
what happens in the short run
Not available for all inter-arrival/service distributions, or (more
importantly) for complex systems (Jackson network is simple, restrictive)
Despite output uncertainty, simulation has major advantages:
No restrictions on input distributions, model form, or complexity so
model validity is facilitated
Can address short-term time frames in fact, steady-state is harder for
simulation (long runs, initialization bias) than for queueing theory
Just have to be mindful of proper statistical design/analysis


Chapter 2 Basics of Queueing Theory 20