Lecture 8 20240427-Handout

Download as pdf or txt
Download as pdf or txt
You are on page 1of 42

Queueing Theory

Introduction
In this chapter we will study a class of models in which
customers arrive in some random manner at a service facility.

Upon arrival they are made to wait in queue until it is their


turn to be served. Once served they are generally assumed
to leave the system.

Interested parameters
the average number of customers in the system (or in the queue)
the average time a customer spends in the system (or spends
waiting in the queue), etc.
What is Queuing Theory?
Mathematical analysis of queues and waiting times in
stochastic systems.
Used extensively to analyze production and service processes
exhibiting random variability in market demand (arrival times) and
service times.

Queues arise when the short term demand for service


exceeds the capacity
Most often caused by random variation in service times and the
times between customer arrivals.
If long term demand for service > capacity, the queue will explode!
Why is Queuing Analysis Important?
Capacity problems are very common in industry and one of
the main drivers of process redesign
Need to balance the cost of increased capacity against the gains of
increased productivity and service

Queuing and waiting time analysis is particularly important in


service systems
Large costs of waiting and of lost sales due to waiting
Examples of Real World Queuing
Systems?
Commercial Queuing Systems
Commercial organizations serving external customers
Ex. Dentist, bank, ATM, gas stations, plumber, garage …
Transportation service systems
Vehicles are customers or servers
Ex. Vehicles waiting at toll stations and traffic lights, trucks or ships
waiting to be loaded, taxi cabs, fire engines, elevators, buses …
Business-internal service systems
Customers receiving service are internal to the organization
providing the service
Ex. Inspection stations, conveyor belts, computer support …
Social service systems
Ex. Judicial process, the ER at a hospital, waiting lists for organ
transplants or student dorm rooms …
Components of a Basic Queuing
Process
Input Source The Queuing System

Served
4. Calling Jobs Service Jobs
Population Queue Mechanism
leave the
system

1. Arrival 3. Queue 5. Queue 2. Service


Process Configuration Discipline Process
Kendall’s Notation
 D. G. Kendall proposed describing queueing models using
three factors written A/S/c/K/N/D, where
A denotes the time between arrivals to the queue
S the service time distribution
c the number of service channels open at the node.
K is the capacity of the queue
N is the size of the population of jobs to be served
D is the queueing discipline
Kendall’s Notation
Arrival Process
M = Memoryless = Poisson
E = Erlang
H = Hyper-exponential
G = General ⇒ Results valid for all distributions

Service Time Distribution


Distribution: M, E, H, or G

Service Disciplines
First-Come-First-Served (FCFS)
Last-Come-First-Served (LCFS)
Last-Come-First-Served with Preempt and Resume (LCFS-PR)
Round-Robin (RR) with a fixed quantum.
Small Quantum ⇒ Processor Sharing (PS)
Infinite Server: (IS) = fixed delay
Shortest Processing Time first (SPT)
Shortest Remaining Processing Time first (SRPT)
Shortest Expected Processing Time first (SEPT)
Shortest Expected Remaining Processing Time first (SERPT).
Biggest-In-First-Served (BIFS)
Loudest-Voice-First-Served (LVFS)
Example: M/M/3/20/1500/FCFS
Time between successive arrivals is exponentially distributed.
Service times are exponentially distributed.
Three servers
20 Buffers = 3 service + 17 waiting
After 20, all arriving jobs are lost
Total of 1500 jobs that can be serviced.
Service discipline is first-come-first-served.
Defaults:
Infinite buffer capacity
Infinite population size
FCFS service discipline.
M/M/1 = M/M/1/∞/∞/FCFS
M/G/1/10 = M/G/1/10/∞/FCFS
Preliminaries: Cost Equations
Key variables
𝑁𝑁(𝑡𝑡)=Number of customers in the system at time t
𝑃𝑃𝑛𝑛 (𝑡𝑡)=Probability that at time t, there are n
customers in the system.
𝜆𝜆𝑛𝑛 =Average arrival intensity at n customers in the
system 𝐿𝐿
𝜇𝜇𝑛𝑛 =Average service intensity for the system when 𝐿𝐿𝑄𝑄
there are n customers in it
𝜌𝜌=Utilization factor for the service facility
λ λ
µ
Some fundamental quantities of interest for
queueing models are 1
𝐿𝐿: the average number of customers in the system 𝑊𝑊𝑄𝑄 µ
𝐿𝐿𝑄𝑄 : the average number of customers waiting in
queue 𝑊𝑊
𝑊𝑊: the average amount of time a customer spends
in the system
𝑊𝑊𝑄𝑄 : the average amount of time a customer spends
waiting in queue
M/M/1 Queue
Arrival process: Poisson process with 𝜆𝜆
𝑃𝑃 𝑁𝑁 𝑡𝑡 = 1 = 𝜆𝜆Δ𝑡𝑡 + 𝑜𝑜(Δ𝑡𝑡)
Service time distribution: exponential with 𝜇𝜇
The probability of a service completion in 𝑡𝑡, 𝑡𝑡 + Δ𝑡𝑡 = 𝜇𝜇Δ𝑡𝑡 + 𝑜𝑜(Δ𝑡𝑡)
The number of servers: one
The capacity of queues: infinity
Let us define 𝑝𝑝𝑛𝑛 as the probability that there are 𝑛𝑛 customers
in the queue, including the one in service

λ μ
Waiting Service
area node
M/M/1 Queue: Transient and
Stationary behaviors
Transient behavior
𝑝𝑝𝑛𝑛 𝑡𝑡 + Δ𝑡𝑡 = 𝑝𝑝𝑛𝑛 𝑡𝑡 1 − 𝜆𝜆Δ𝑡𝑡 1 − 𝜇𝜇Δ𝑡𝑡 + 𝜇𝜇Δ𝑡𝑡 ⋅ 𝜆𝜆Δ𝑡𝑡 + 𝑜𝑜 Δ𝑡𝑡
+𝑝𝑝𝑛𝑛−1 𝑡𝑡 𝜆𝜆Δ𝑡𝑡 1 − 𝜇𝜇Δ𝑡𝑡 + 𝑜𝑜 Δ𝑡𝑡
+𝑝𝑝𝑛𝑛+1 𝑡𝑡 𝜇𝜇Δ𝑡𝑡 1 − 𝜆𝜆Δ𝑡𝑡 + 𝑜𝑜 Δ𝑡𝑡
→ 𝑝𝑝𝑛𝑛 𝑡𝑡 + Δ𝑡𝑡 = 𝑝𝑝𝑛𝑛 𝑡𝑡 1 − 𝜆𝜆 + 𝜇𝜇 Δ𝑡𝑡 + 𝑝𝑝𝑛𝑛−1 𝑡𝑡 𝜆𝜆Δ𝑡𝑡 + 𝑝𝑝𝑛𝑛+1 𝑡𝑡 𝜇𝜇Δ𝑡𝑡
𝑑𝑑𝑝𝑝 𝑡𝑡
From a Tailor series such that 𝑝𝑝𝑛𝑛 𝑡𝑡 + Δ𝑡𝑡 = 𝑝𝑝𝑛𝑛 𝑡𝑡 + 𝑛𝑛 Δ𝑡𝑡
𝑑𝑑𝑑𝑑
𝑑𝑑𝑝𝑝𝑛𝑛 𝑡𝑡
= − 𝜆𝜆 + 𝜇𝜇 𝑝𝑝𝑛𝑛 𝑡𝑡 + 𝑝𝑝𝑛𝑛−1 𝑡𝑡 𝜆𝜆 + 𝑝𝑝𝑛𝑛+1 𝑡𝑡 𝜇𝜇
𝑑𝑑𝑑𝑑

𝑑𝑑𝑝𝑝𝑛𝑛 𝑡𝑡
Stationary behavior (Non-time varying probability) =0
𝑑𝑑𝑑𝑑
 𝜆𝜆 + 𝜇𝜇 𝑝𝑝𝑛𝑛 = 𝜆𝜆𝑝𝑝𝑛𝑛−1 + 𝜇𝜇𝑝𝑝𝑛𝑛+1 for 𝑛𝑛 ≥ 1
M/M/1 Queue: State Diagram
𝜆𝜆 𝜆𝜆 𝜆𝜆 𝜆𝜆 𝜆𝜆

0 1 2 3 4
𝜇𝜇 𝜇𝜇 𝜇𝜇 𝜇𝜇 𝜇𝜇

Surface 2 𝜆𝜆𝑝𝑝𝑛𝑛 = 𝜇𝜇𝑝𝑝𝑛𝑛+1

𝜆𝜆 𝜆𝜆 𝜆𝜆 𝜆𝜆 𝜆𝜆

0 1 2 3 4
𝜇𝜇 𝜇𝜇 𝜇𝜇 𝜇𝜇 𝜇𝜇
Surface 1
𝜆𝜆 + 𝜇𝜇 𝑝𝑝𝑛𝑛 = 𝜆𝜆𝑝𝑝𝑛𝑛−1 + 𝜇𝜇𝑝𝑝𝑛𝑛+1
M/M/1 Queue: State Probability
𝜆𝜆𝑝𝑝𝑛𝑛 = 𝜇𝜇𝑝𝑝𝑛𝑛+1 (balance equation)
𝜆𝜆
𝑝𝑝𝑛𝑛 = 𝜌𝜌𝑛𝑛 𝑝𝑝0 , 𝜌𝜌 =
𝜇𝜇
𝜆𝜆
Σ𝑛𝑛 𝑝𝑝𝑛𝑛 = 1 → 𝑝𝑝𝑛𝑛 = 1 − 𝜌𝜌 𝜌𝜌𝑛𝑛 , 𝜌𝜌 = <1
𝜇𝜇
M/M/1 state probability distribution is geometric distribution
𝜌𝜌 < 1 is the necessary condition. If violated, equilibrium is
never reached.
The M/M/1 state probability distribution is geometric
𝑝𝑝0 is the probability that the queue is empty.
𝜌𝜌 is called utilization, the probability that the queue is non-empty.
M/M/1/N Queue
Accommodating at most N packets
The balance equation is unchanged except for the two
boundary points 𝑛𝑛 = 0, and 𝑛𝑛 = 𝑁𝑁
1−𝜌𝜌 1−𝜌𝜌
Σ𝑛𝑛 𝑝𝑝𝑛𝑛 = 1  𝑝𝑝0 = , 𝑝𝑝𝑛𝑛 = 𝜌𝜌𝑛𝑛 𝑝𝑝0 = 𝜌𝜌𝑛𝑛 , 𝑛𝑛 = 1,2 … , 𝑁𝑁
1−𝜌𝜌𝑁𝑁+1 1−𝜌𝜌𝑁𝑁+1
1−𝜌𝜌
𝑝𝑝𝑁𝑁 = 𝜌𝜌𝑁𝑁
1−𝜌𝜌𝑁𝑁+1
The probability that the queue is full=the probability of blocking 𝑃𝑃𝐵𝐵
With the blocking probability 𝑃𝑃𝐵𝐵 , the net arrival rate is
𝜆𝜆 1 − 𝑃𝑃𝐵𝐵
Throughput= 𝛾𝛾 = 𝜆𝜆 1 − 𝑃𝑃𝐵𝐵

𝜆𝜆 = 𝑙𝑙𝑙𝑙𝑙𝑙𝑙𝑙
Throughput= 𝛾𝛾 = 𝜆𝜆 1 − 𝑃𝑃𝐵𝐵
𝜆𝜆𝑃𝑃𝐵𝐵 Queue
M/M/1/N Queue:
Another Interpretation
For single-server queue, the type of queue, the average rate
of service would be 𝜇𝜇 in customers/sec served on the
average, if the queue were always nonempty
Since the queue is sometimes empty, with probability 𝑝𝑝0 , the
actual rate of service, or throughput 𝛾𝛾, is less than 𝜇𝜇.
More precisely, 𝛾𝛾 = 𝜇𝜇 1 − 𝑝𝑝0 , since 1 − 𝑝𝑝0 is the probability
that the queue is nonempty
There is no blocking and the throughput 𝛾𝛾 = 𝜆𝜆, the average arrival
rate. 𝜆𝜆 = 𝜇𝜇 1 − 𝑝𝑝0
𝛾𝛾 = 𝜆𝜆 1 − 𝑃𝑃𝐵𝐵 = 𝜇𝜇 1 − 𝑝𝑝0
1−𝜌𝜌 𝜌𝜌𝑁𝑁+1 ≪1
𝑃𝑃𝐵𝐵 = 𝑝𝑝𝑁𝑁 = 𝜌𝜌𝑁𝑁 1 − 𝜌𝜌 𝜌𝜌𝑛𝑛
1−𝜌𝜌𝑁𝑁+1
The region 𝜌𝜌 > 1 is said to be the congested region
𝛾𝛾 = 𝜆𝜆 1 − 𝑃𝑃λ𝐵𝐵 μ 𝛾𝛾 = 𝜇𝜇 1 − 𝑝𝑝0
Waiting Service
area node
M/M/1 Queue: Properties
Statistics of interest: 𝐸𝐸 𝐿𝐿 , 𝐸𝐸 𝑊𝑊𝑞𝑞 , 𝐸𝐸 𝑊𝑊 etc

Average of the queue size


𝜌𝜌
𝐸𝐸 𝐿𝐿 = Σ𝑛𝑛 𝑛𝑛𝑝𝑝𝑛𝑛 =
1−𝜌𝜌
As the load increases the throughput goes up but blocking and time delay also
increase.
𝐿𝐿
Little’s formula: 𝐿𝐿� = 𝜆𝜆𝑊𝑊
� 𝐿𝐿𝑞𝑞
We will not drive it here.
𝐿𝐿� : the average number of customers λ λ
� the average waiting time
𝑊𝑊: µ
1
𝜆𝜆: the arrival rate µ
𝑊𝑊𝑞𝑞
The average wait time and the average delay 𝑊𝑊
1
𝐸𝐸 𝐿𝐿𝑞𝑞 = 𝐸𝐸 𝑊𝑊𝑞𝑞 +
𝜇𝜇

The average number of customers 𝐸𝐸 𝐿𝐿𝑞𝑞 waiting in the queue


𝜆𝜆
𝐸𝐸 𝐿𝐿𝑞𝑞 = 𝜆𝜆𝜆𝜆 𝑊𝑊𝑞𝑞 = 𝜆𝜆𝜆𝜆 𝑊𝑊 − = 𝜆𝜆𝜆𝜆 𝑊𝑊 − 𝜌𝜌
𝜇𝜇
State Dependent Queues
Arrival and departure rates are dependent on the state of the
system (Birth-death process) (e.g) M/M/m
The balance equation governing the operation of the state-
dependent queueing system at equilibrium
𝜆𝜆𝑛𝑛 + 𝜇𝜇𝑛𝑛 𝑝𝑝𝑛𝑛 = 𝜆𝜆𝑛𝑛−1 𝑝𝑝𝑛𝑛−1 + 𝜇𝜇𝑛𝑛+1 𝑝𝑝𝑛𝑛+1 , 𝑓𝑓𝑓𝑓𝑓𝑓 𝑛𝑛 ≥ 1
→ 𝜆𝜆𝑛𝑛 𝑝𝑝𝑛𝑛 = 𝜇𝜇𝑛𝑛+1 𝑝𝑝𝑛𝑛+1 , 𝑓𝑓𝑓𝑓𝑓𝑓 𝑛𝑛 ≥ 1
𝑛𝑛−1 𝑛𝑛
𝑝𝑝𝑛𝑛 /𝑝𝑝0 = ∏𝑖𝑖=0 𝜆𝜆𝑖𝑖 / ∏𝑖𝑖=1 𝜇𝜇𝑖𝑖
Σ𝑛𝑛 𝑝𝑝𝑛𝑛 = 1

𝜆𝜆0 𝜆𝜆1 𝜆𝜆2 𝜆𝜆3 𝜆𝜆4

0 1 2 3 4
𝜇𝜇1 𝜇𝜇2 𝜇𝜇3 𝜇𝜇4 𝜇𝜇5
𝑛𝑛

M/M/2 𝜆𝜆 𝜇𝜇

𝜇𝜇

Two outgoing trunks connecting a packet switch to a


neighboring packet switch
𝜆𝜆𝑛𝑛 = 𝜆𝜆
𝜇𝜇𝑛𝑛 = 𝜇𝜇, 𝑛𝑛 = 1, and 𝜇𝜇𝑛𝑛 = 2𝜇𝜇, 𝑛𝑛 > 1
𝑝𝑝 ∏𝑛𝑛−1
𝑖𝑖=0 𝜆𝜆𝑖𝑖 𝜆𝜆 𝑛𝑛−1 𝜆𝜆 𝜆𝜆
 𝑛𝑛 = ∏𝑛𝑛
= = 2𝜌𝜌𝑛𝑛 , 𝑛𝑛 ≥ 1, 𝜌𝜌 =
𝑝𝑝0 𝑖𝑖=1 𝜇𝜇𝑖𝑖 2𝜇𝜇 𝜇𝜇 2𝜇𝜇
1−𝜌𝜌
Σ𝑛𝑛 𝑝𝑝𝑛𝑛 = 1 → 𝑝𝑝0 = ,
1+𝜌𝜌
1−𝜌𝜌
𝑝𝑝𝑛𝑛 = 𝑝𝑝0 2𝜌𝜌𝑛𝑛 = 2 𝜌𝜌𝑛𝑛
1+𝜌𝜌
2𝜌𝜌 𝜆𝜆
𝐸𝐸 𝐿𝐿 = Σ𝑛𝑛 𝑛𝑛𝑝𝑝𝑛𝑛 = , 𝜌𝜌 = ,
1−𝜌𝜌2 2𝜇𝜇
𝐸𝐸 𝐿𝐿 2 1
𝐸𝐸 𝑊𝑊 = =
𝜆𝜆 1−𝜌𝜌2 𝜇𝜇

The average throughput 𝛾𝛾 = 𝜇𝜇𝑝𝑝1 + 2𝜇𝜇(1 − 𝑝𝑝0 − 𝑝𝑝1 )


𝜆𝜆 𝜆𝜆 𝜆𝜆 𝜆𝜆 𝜆𝜆

0 1 2 3 4
𝜇𝜇 2𝜇𝜇 2𝜇𝜇 2𝜇𝜇 2𝜇𝜇
M/M/1 vs M/M/2 vs M/M/1 with 2𝜇𝜇
Other examples
M/M/∞

Queue with discouragement

M/M/N/N
Other examples: M/M/∞
 The number of trunks is equal to the number of calls. No
queueing up for service nor a probability of blocking
𝜆𝜆𝑛𝑛 = 𝜆𝜆
𝜇𝜇𝑛𝑛 = 𝑛𝑛𝑛𝑛, 𝑛𝑛 ≥ 1
𝜆𝜆 𝑛𝑛
𝑝𝑝 ∏𝑛𝑛−1
𝑖𝑖=0 𝜆𝜆𝑖𝑖 𝜇𝜇 𝜌𝜌𝑛𝑛 𝜆𝜆
 𝑛𝑛 = ∏𝑛𝑛
= = , 𝑛𝑛 ≥ 1, 𝜌𝜌 =
𝑝𝑝0 𝑖𝑖=1 𝜇𝜇𝑖𝑖 𝑛𝑛! 𝑛𝑛! 𝜇𝜇
Σ𝑛𝑛 𝑝𝑝𝑛𝑛 = 1 → 𝑝𝑝0 = 𝑒𝑒 −𝜌𝜌 ,
𝜌𝜌𝑛𝑛 𝑛𝑛
𝜌𝜌
𝑝𝑝𝑛𝑛 = 𝑝𝑝0 𝑛𝑛! = 𝑒𝑒 −𝜌𝜌 𝑛𝑛! (Poisson!!!)
𝜆𝜆
𝐸𝐸 𝐿𝐿 = Σ𝑛𝑛 𝑛𝑛𝑝𝑝𝑛𝑛 = 𝜌𝜌 = ,
𝜇𝜇
𝐸𝐸 𝑛𝑛 1
𝐸𝐸 𝑇𝑇 = =
𝜆𝜆 𝜇𝜇

The average throughput


𝛾𝛾 = Σ𝑛𝑛≥0 𝜇𝜇𝑛𝑛 𝑝𝑝𝑛𝑛 = 𝜇𝜇Σ𝑛𝑛≥0 𝑛𝑛𝑝𝑝𝑛𝑛 = 𝜇𝜇𝜇𝜇 𝐿𝐿 = 𝜆𝜆
Other examples:
Queue with discouragement
 A system with customer flow control at the input (e.g.)
moviegoers and shoppers at a single line to serve
𝜆𝜆
𝜆𝜆𝑛𝑛 =
𝑛𝑛+1
𝜇𝜇𝑛𝑛 = 𝜇𝜇, 𝑛𝑛 ≥ 1
𝜆𝜆 𝑛𝑛
𝑝𝑝 ∏𝑛𝑛−1
𝑖𝑖=0 𝜆𝜆𝑖𝑖 𝜇𝜇 𝜌𝜌𝑛𝑛 𝜆𝜆
 𝑛𝑛 = ∏𝑛𝑛
= = , 𝑛𝑛 ≥ 1, 𝜌𝜌 = (the same as M/M/∞)
𝑝𝑝0 𝑖𝑖=1 𝜇𝜇𝑖𝑖 𝑛𝑛! 𝑛𝑛! 𝜇𝜇
Σ𝑛𝑛 𝑝𝑝𝑛𝑛 = 1 → 𝑝𝑝0 = 𝑒𝑒 −𝜌𝜌 ,
𝜌𝜌𝑛𝑛 𝜌𝜌𝑛𝑛
𝑝𝑝𝑛𝑛 = 𝑝𝑝0 = 𝑒𝑒 −𝜌𝜌
𝑛𝑛! 𝑛𝑛!
The average throughput
𝛾𝛾 = Σ𝑛𝑛≥0 𝜆𝜆𝑛𝑛 𝑝𝑝𝑛𝑛 = 𝜇𝜇 1 − 𝑒𝑒 −𝜌𝜌
𝜆𝜆
𝐸𝐸 𝐿𝐿 = Σ𝑛𝑛 𝑛𝑛𝑝𝑝𝑛𝑛 = 𝜌𝜌 = ,
𝜇𝜇
𝐸𝐸 𝑛𝑛 1 1 𝜆𝜆
𝐸𝐸 𝑊𝑊 = = , 𝜌𝜌 =
𝛾𝛾 𝜇𝜇 1−𝑒𝑒 −𝜌𝜌 𝜇𝜇
Other examples: M/M/N/N
 The number of trunks is equal to the number of calls. No queueing up
for service nor a probability of blocking
𝜆𝜆𝑛𝑛 = 𝜆𝜆
𝜇𝜇𝑛𝑛 = 𝑛𝑛𝑛𝑛, 𝑛𝑛 ≥ 1
𝜆𝜆 𝑛𝑛
𝑝𝑝𝑛𝑛 ∏𝑛𝑛−1
𝑖𝑖=0 𝜆𝜆𝑖𝑖 𝜇𝜇 𝜌𝜌𝑛𝑛 𝜆𝜆
 = ∏𝑛𝑛
= = , 𝑛𝑛 ≥ 1, 𝜌𝜌 =
𝑝𝑝0 𝑖𝑖=1 𝜇𝜇𝑖𝑖 𝑛𝑛! 𝑛𝑛! 𝜇𝜇
𝑁𝑁 1
∑𝑛𝑛=0 𝑝𝑝𝑛𝑛 = 1 → 𝑝𝑝0 = 𝜌𝜌𝑛𝑛
,
∑𝑁𝑁
𝑛𝑛=0 𝑛𝑛!
𝜌𝜌𝑛𝑛 1
𝑝𝑝𝑛𝑛 = 𝑛𝑛
𝑛𝑛! ∑𝑁𝑁 𝜌𝜌
𝑛𝑛=0 𝑛𝑛!
𝜌𝜌𝑁𝑁 1
𝑝𝑝𝐵𝐵 = 𝑛𝑛 (Erlang-B distribution)
𝑁𝑁! ∑𝑁𝑁 𝜌𝜌
𝑛𝑛=0 𝑛𝑛!
𝜆𝜆
𝐸𝐸 𝐿𝐿 = 𝜌𝜌 1 − 𝑃𝑃𝐵𝐵 , 𝜌𝜌 =
𝜇𝜇
The average throughput 𝑁𝑁

𝛾𝛾 = 𝜆𝜆 1 − 𝑃𝑃𝐵𝐵 = � 𝜇𝜇𝑛𝑛 𝑝𝑝𝑛𝑛 = 𝜇𝜇𝜇𝜇 𝐿𝐿


𝑛𝑛=0
𝐸𝐸 𝐿𝐿 1
𝐸𝐸 𝑊𝑊 = =
𝛾𝛾 𝜇𝜇
M/G/1 Queue:
Mean Value Analysis
 The arrival process is Poisson, but a general service-time distribution
 The Pollaczek-Khinchine formulas
𝜌𝜌 𝜌𝜌
𝐸𝐸 𝐿𝐿 = 1− 1 − 𝜇𝜇2 𝜎𝜎 2
1−𝜌𝜌 2
𝑐𝑐𝑐𝑐𝑐𝑐𝑐𝑐𝑐𝑐𝑐𝑐𝑐𝑐𝑐𝑐𝑐𝑐𝑐𝑐
1 𝑓𝑓𝑓𝑓𝑓𝑓𝑓𝑓𝑓𝑓𝑓𝑓
𝐸𝐸 𝐿𝐿 𝜇𝜇 𝜌𝜌
𝐸𝐸 𝑊𝑊 = = 1− 1 − 𝜇𝜇2 𝜎𝜎 2
𝜆𝜆 1−𝜌𝜌 2
𝜆𝜆
𝜌𝜌 = = 𝜆𝜆𝜆𝜆 𝜏𝜏
𝜇𝜇
 𝜆𝜆: the average Poisson arrival rate
1
 𝐸𝐸(𝜏𝜏) = 𝜇𝜇: the average service time
𝜎𝜎 2 : the variance of the service-time distribution
1
 For 𝜎𝜎 2 > 𝜇𝜇2 , 𝐸𝐸 𝐿𝐿 and 𝐸𝐸 𝑊𝑊 increase as 𝜎𝜎 2 increases
1
 For 𝜎𝜎 2 < 𝜇𝜇2 , 𝐸𝐸 𝐿𝐿 and 𝐸𝐸 𝑊𝑊 decrease relative to M/M/1 as 𝜎𝜎 2 decreases
1 𝜆𝜆𝜆𝜆 𝜏𝜏2
𝐸𝐸 𝑊𝑊𝑞𝑞 = 𝐸𝐸 𝑊𝑊 − =
𝜇𝜇 2 1−𝜌𝜌
2 2 1
 𝐸𝐸 𝜏𝜏 = 𝜎𝜎 + 𝜇𝜇2
: the second moment of the service-time distribution
1
 M/M/1: 𝜎𝜎 2 = 2
𝜇𝜇
1
2 𝜌𝜌 𝜌𝜌 𝜇𝜇 𝜌𝜌
 M/D/1: : 𝜎𝜎 = 0, 𝐸𝐸 𝐿𝐿 = 1− , 𝐸𝐸 𝑊𝑊 = 1−
1−𝜌𝜌 2 1−𝜌𝜌 2
Example 8.2 M/M/1
Suppose that customers arrive at a Poisson rate of one per
every 12 minutes, and that service time is exponential at a
rate of one service per 8 minutes. What are 𝐸𝐸(𝐿𝐿) and 𝐸𝐸(𝑊𝑊)?
1
1 1 8 2
[Answer] 𝜆𝜆 = , 𝜇𝜇 = , 𝜌𝜌 = 12
1 = =
12 8 12 3
8
𝜌𝜌
𝐸𝐸 𝐿𝐿 = Σ𝑛𝑛 𝑛𝑛𝑝𝑝𝑛𝑛 = =2
1−𝜌𝜌
𝐸𝐸 𝑛𝑛 1/𝜇𝜇
𝐸𝐸 𝑊𝑊 = = = 24
𝜆𝜆 1−𝜌𝜌
Example 8.3 M/M/N/N
Suppose that it costs 𝑐𝑐𝑐𝑐 dollars per hour to provide service at rate
𝜇𝜇. Suppose also that we incur a gross profit of A dollars for each
customer served. If the system has a capacity N, what service rate
maximizes our total profit? Assume that the arrival rate is 𝜆𝜆.
[Answer]
1−𝜌𝜌 𝜆𝜆
𝑃𝑃𝑛𝑛 = 𝜌𝜌𝑛𝑛 , 𝜌𝜌 =
1−𝜌𝜌𝑁𝑁+1 𝜇𝜇
Throughput is 𝛾𝛾 = 𝜆𝜆 1 − 𝑃𝑃𝑁𝑁
Profit per hour = 𝜆𝜆 1 − PN A − c𝜇𝜇
1 − 𝜌𝜌
= 𝜆𝜆 1 − 𝜌𝜌𝑁𝑁+1 A − c𝜇𝜇
1 − 𝜌𝜌𝑁𝑁+1
𝜆𝜆A 1 − 𝜌𝜌𝑁𝑁
= − c𝜇𝜇
1 − 𝜌𝜌𝑁𝑁+1
If N = 2, 𝜆𝜆 = 1, 𝐴𝐴 = 10, 𝑐𝑐 = 1, then
10 𝜇𝜇3 −𝜇𝜇
 Profit per hour = − 𝜇𝜇
𝜇𝜇3 −1
𝑑𝑑 10 2𝜇𝜇3 −3𝜇𝜇2 +1
 𝑝𝑝𝑝𝑝𝑝𝑝𝑝𝑝𝑝𝑝𝑝𝑝 𝑝𝑝𝑝𝑝𝑝𝑝 ℎ𝑜𝑜𝑜𝑜𝑜𝑜 = −1
𝑑𝑑𝑑𝑑 𝜇𝜇3 −1 2
Network of Queues
Network of Queue: model in which jobs departing from one
queue arrive at another queue (or possibly the same queue)
Open systems
Customers arrive from outside the system are served and then
depart.
Example: Packet switched data network.

Closed systems
Fixed number of customers (K) are trapped in the system and
circulate among the queues.
Example: CPU job scheduling problem

Mixed systems
Example of Open Systems:
Tandom system
Consider a two-server system in which customers arrive at a
Poisson rate 𝜆𝜆 at server 1. After being served by server 1
then join the queue in front of server 2
There is infinite waiting space at both servers
Each server serves on customer at a time which server 𝑖𝑖
taking an exponential time with rate 𝜇𝜇𝑖𝑖 for a server 𝑖𝑖 = 1, 2.
A tandom (or sequential) system

𝜆𝜆 Leaves
Server1 Server2 system
Analysis of a Tandom System
To analyze this system, keep tack of the number of
customers at the servers and define the state by the pair
(𝑛𝑛, 𝑚𝑚), where 𝑛𝑛 customers at server 1 and 𝑚𝑚 customers at
server 2

(0,0) (0,1) (0,2) (0,3) (0,3)

(1,0) (1,1) (1,2) (1,3) (1,4)

(2,0) (2,1) (2,2) (2,3) (2,4)


Analysis of a Tandom System
To analyze this system, keep tack of the number of
customers at the servers and define the state by the pair
(𝑛𝑛, 𝑚𝑚), where 𝑛𝑛 customers at server 1 and 𝑚𝑚 customers at
server 2

(0,0) (0,1) (0,2) (0,3) (0,4)

𝜇𝜇2 𝜇𝜇2 𝜇𝜇2 𝜇𝜇2 𝜇𝜇2


𝜆𝜆 𝜆𝜆 𝜆𝜆 𝜆𝜆 𝜆𝜆
𝜇𝜇1 𝜇𝜇1 𝜇𝜇1 𝜇𝜇1 𝜇𝜇1
(1,0) (1,1) (1,2) (1,3) (1,4)

𝜇𝜇2 𝜇𝜇2 𝜇𝜇2 𝜇𝜇2 𝜇𝜇2


𝜆𝜆 𝜆𝜆 𝜆𝜆 𝜆𝜆 𝜆𝜆
𝜇𝜇1 𝜇𝜇1 𝜇𝜇1 𝜇𝜇1 𝜇𝜇1
(2,0) (2,1) (2,2) (2,3) (2,4)

𝜇𝜇2 𝜇𝜇2 𝜇𝜇2 𝜇𝜇2 𝜇𝜇2


𝜆𝜆 𝜇𝜇1 𝜆𝜆 𝜇𝜇1 𝜆𝜆 𝜇𝜇1 𝜆𝜆 𝜇𝜇1 𝜆𝜆 𝜇𝜇1
Balance Equation

State Rate that the process leaves = rate that it enters

0,0 𝜆𝜆𝑃𝑃0,0 = 𝜇𝜇2 𝑃𝑃0,1

𝑛𝑛, 0; 𝑛𝑛 > 0 𝜆𝜆 + 𝜇𝜇1 𝑃𝑃𝑛𝑛,0 = 𝜇𝜇2 𝑃𝑃𝑛𝑛,1 + 𝜆𝜆𝑃𝑃𝑛𝑛−1,0

0, 𝑚𝑚: 𝑚𝑚 > 0 𝜆𝜆 + 𝜇𝜇2 𝑃𝑃0,𝑚𝑚 = 𝜇𝜇2 𝑃𝑃0,𝑚𝑚+1 + 𝜇𝜇1 𝑃𝑃1,𝑚𝑚−1

𝑛𝑛, 𝑚𝑚; 𝑛𝑛𝑛𝑛 > 0 𝜆𝜆 + 𝜇𝜇1 + 𝜇𝜇2 𝑃𝑃𝑛𝑛,𝑚𝑚 = 𝜇𝜇2 𝑃𝑃𝑛𝑛,𝑚𝑚+1 + 𝜇𝜇1 𝑃𝑃𝑛𝑛+1,𝑚𝑚−1 + 𝜆𝜆𝑃𝑃𝑛𝑛−1,𝑚𝑚−1

Σ𝑛𝑛,𝑚𝑚 𝑃𝑃𝑛𝑛,𝑚𝑚 = 1
Probability of State
The departure process of an M/M/1 queue is a Poisson
process with rate 𝜆𝜆, it follows that what server 2 faces is also
an M/M/1 queue.
𝜆𝜆 𝑛𝑛 𝜆𝜆
𝑃𝑃 𝑛𝑛 𝑎𝑎𝑎𝑎 𝑠𝑠𝑠𝑠𝑠𝑠𝑠𝑠𝑠𝑠𝑠𝑠 1 = 1−
𝜇𝜇1 𝜇𝜇1
𝜆𝜆 𝑚𝑚 𝜆𝜆
𝑃𝑃 𝑚𝑚 𝑎𝑎𝑎𝑎 𝑠𝑠𝑠𝑠𝑠𝑠𝑠𝑠𝑠𝑠𝑠𝑠 2 = 1 −
𝜇𝜇2 𝜇𝜇2

If the numbers of customers at servers 1 and 2 were


independent random variables, then it would follow that
𝜆𝜆 𝑛𝑛 𝜆𝜆 𝜆𝜆 𝑚𝑚 𝜆𝜆
𝑃𝑃𝑛𝑛,𝑚𝑚 = 1− 1−
𝜇𝜇1 𝜇𝜇1 𝜇𝜇2 𝜇𝜇2

Verification is left for assignment


Properties
The average number of customers in the system
𝐸𝐸 𝐿𝐿 = ∑𝑛𝑛,𝑚𝑚 𝑛𝑛 + 𝑚𝑚 𝑃𝑃𝑛𝑛,𝑚𝑚
𝑛𝑛 𝑚𝑚
𝜆𝜆 𝜆𝜆 𝜆𝜆 𝜆𝜆
= � 𝑛𝑛 1− + � 𝑚𝑚 1−
𝜇𝜇1 𝜇𝜇1 𝜇𝜇2 𝜇𝜇2
𝑛𝑛 𝑚𝑚
𝜆𝜆 𝜆𝜆
= +
𝜇𝜇1 − 𝜆𝜆 𝜇𝜇2 − 𝜆𝜆
𝐿𝐿 1 1
𝐸𝐸 𝑊𝑊 = = −𝜆𝜆 + −𝜆𝜆
𝜆𝜆 𝜇𝜇1 𝜇𝜇2
Generalization of Tandom System:
Jackson Network
Consider system of 𝑘𝑘 servers.
Customers arrive from outside the system to server 𝑖𝑖, 𝑖𝑖 = 1, … , 𝑘𝑘 in
accordance with independent Poisson processes at rate 𝑟𝑟𝑖𝑖
Once a customer is served by server 𝑖𝑖, the then joins the queue in
front of server 𝑗𝑗, 𝑗𝑗 = 1, … , 𝑘𝑘 with probability 𝑃𝑃𝑖𝑖𝑖𝑖 .
𝜇𝜇𝑗𝑗 is the exponential service rate at server 𝑗𝑗
𝑘𝑘
𝜆𝜆𝑗𝑗 = 𝑟𝑟𝑗𝑗 + Σ𝑖𝑖=1 𝜆𝜆𝑃𝑃𝑖𝑖𝑖𝑖 , 𝑖𝑖 = 1, … , 𝑘𝑘
𝑛𝑛
𝜆𝜆𝑗𝑗 𝜆𝜆 𝜆𝜆
𝑃𝑃 𝑛𝑛 𝑎𝑎𝑎𝑎 𝑠𝑠𝑠𝑠𝑠𝑠𝑠𝑠𝑠𝑠𝑠𝑠 𝑗𝑗 = 𝜇𝜇𝑗𝑗
1 − 𝜇𝜇𝑗𝑗 , 𝑛𝑛 ≥ 1, 𝜇𝜇𝑗𝑗 < 1
𝑗𝑗 𝑗𝑗
𝑛𝑛𝑗𝑗
𝑘𝑘 𝜆𝜆𝑗𝑗 𝜆𝜆𝑗𝑗
𝑃𝑃𝑛𝑛1 ,…,𝑛𝑛𝑘𝑘 = Π𝑗𝑗=1 1−
𝜇𝜇𝑗𝑗 𝜇𝜇𝑗𝑗
𝑘𝑘 𝑘𝑘 𝜆𝜆𝑗𝑗
𝐸𝐸 𝐿𝐿 = Σ𝑖𝑖=1 𝑎𝑎𝑎𝑎𝑎𝑎𝑎𝑎𝑎𝑎𝑎𝑎𝑎𝑎 𝑛𝑛𝑛𝑛𝑛𝑛𝑛𝑛𝑛𝑛 𝑎𝑎𝑎𝑎 𝑠𝑠𝑠𝑠𝑠𝑠𝑠𝑠𝑠𝑠𝑠𝑠 𝑗𝑗 = Σ𝑗𝑗=1 𝜇𝜇𝑗𝑗 −𝜆𝜆𝑗𝑗
𝜆𝜆𝑗𝑗
Σ𝑘𝑘
𝑗𝑗=1 𝜇𝜇 −𝜆𝜆
𝐿𝐿 𝐿𝐿 𝑗𝑗 𝑗𝑗
𝐸𝐸 𝑊𝑊 = = =
𝜆𝜆 Σ𝑘𝑘
𝑗𝑗=1 𝑟𝑟𝑗𝑗
𝑘𝑘
Σ𝑗𝑗=1 𝑟𝑟𝑗𝑗
Jackson Network
James Jackson (UCLA Math professor) did the basic work on
queueing networks
Jackson Networks – special class of open queueing networks
Network of M queues
There is only one class of customers in the network
A job can leave the network from any node
All service times are exponentially distributed with rate 𝜇𝜇𝑗𝑗 at queue 𝑗𝑗
The service discipline at all nodes is FCFS.
All external customer arrival processes are Poisson processes with
rate 𝑟𝑟𝑗𝑗 at queue 𝑗𝑗
Jackson’s Theorem
If in an open network 𝜆𝜆𝑖𝑖 < 𝜇𝜇𝑖𝑖 holds for all queues 𝑖𝑖 = 1, . . , 𝑀𝑀
the arrival rates 𝜆𝜆𝑖𝑖 can be computed by
𝝀𝝀 = 𝒓𝒓 𝑰𝑰 − 𝑹𝑹 −𝟏𝟏
where 𝝀𝝀 = 𝜆𝜆1 , … , 𝜆𝜆𝑀𝑀
𝒓𝒓 = [𝑟𝑟1 , 𝑟𝑟2 , … , 𝑟𝑟𝑀𝑀 ]
𝑷𝑷 = [𝑃𝑃𝑖𝑖𝑖𝑖 ]
The steady-state probability of the network can be expressed as the
product of the state probabilities of the individual queues.
𝑃𝑃𝑛𝑛1,…,𝑛𝑛𝑀𝑀 = 𝑃𝑃𝑛𝑛1 𝑃𝑃𝑛𝑛2 ⋯ 𝑃𝑃𝑛𝑛𝑀𝑀
The nodes of the network can be considered at independent
M/M/1 queues with arrival rate 𝜆𝜆𝑖𝑖 and service rate 𝜇𝜇𝑖𝑖
Open Networks: Example
Three node network shown below
Poisson external arrivals with 𝜆𝜆1 = 0.5, 𝜆𝜆2 = 0.25, 𝜆𝜆3 = 0.25
Exponential service at each queue with 𝜇𝜇1 = 1, 𝜇𝜇2 = 1, 𝜇𝜇3 = 1

From the diagram 𝑃𝑃12 = 0.4, 𝑃𝑃13 = 0.6, 𝑃𝑃32 = 0.25, 𝑃𝑃24 =
1.0, 𝑃𝑃34 = 0.75
0 0.4 0.6
𝑅𝑅 = 0 0 0 𝜆𝜆 = 𝑟𝑟 𝐼𝐼 − 𝑅𝑅 1 = [0.5, 0.5875, 055]
0 0.25 0
Closed System
A system in which new customers never enter and existing
ones never depart
Simplest case 𝑘𝑘 customers circulating among 𝑚𝑚 queues
Each queue 𝑖𝑖 has exponentially distributed service time 𝜇𝜇𝑖𝑖
State of network defined by (𝑛𝑛1 , 𝑛𝑛2 , … , 𝑛𝑛𝑚𝑚 )
Example m=2, k=3
Closed System
The limiting probability
𝑃𝑃𝑘𝑘 𝑛𝑛1 , … , 𝑛𝑛𝑚𝑚 = 𝑃𝑃{𝑛𝑛𝑗𝑗 𝑐𝑐𝑐𝑐𝑐𝑐𝑐𝑐𝑐𝑐𝑐𝑐𝑐𝑐𝑐𝑐𝑐𝑐 𝑎𝑎𝑎𝑎𝑎𝑎 𝑠𝑠𝑠𝑠𝑠𝑠𝑠𝑠𝑠𝑠𝑠𝑠 𝑗𝑗, 𝑗𝑗 = 1, . . , 𝑚𝑚}
From the balance equation
𝑚𝑚 𝑛𝑛𝑗𝑗 𝑚𝑚
𝜆𝜆𝑘𝑘 𝑗𝑗
𝑃𝑃𝑘𝑘 𝑛𝑛1 , … , 𝑛𝑛𝑚𝑚 �𝑀𝑀𝑘𝑘 �𝑗𝑗=1 𝜇𝜇𝑗𝑗
𝑖𝑖𝑖𝑖 �
𝑗𝑗=1
𝑛𝑛𝑗𝑗 = 𝑘𝑘

0
−1
𝑛𝑛𝑗𝑗
𝜆𝜆𝑘𝑘 𝑗𝑗
where 𝑀𝑀𝑘𝑘 = ∑𝑛𝑛1,…,𝑛𝑛𝑘𝑘 : ∏𝑚𝑚
𝑗𝑗=1 𝜇𝜇𝑗𝑗
Σ𝑛𝑛𝑗𝑗 =𝑘𝑘
Example of Closed Systems
Example m=2, k=3
From the diagram 𝑃𝑃12 = 𝑃𝑃21 = 1
State space 𝑆𝑆 = 0,3 , 1,2 , 2,1 , 3,0
−1
𝑛𝑛𝑗𝑗 3 1 𝜆𝜆 2 2
𝜆𝜆𝑘𝑘 𝑗𝑗 𝜆𝜆𝑘𝑘 2 𝜆𝜆𝑘𝑘 1
𝑀𝑀𝑘𝑘 = ∑𝑛𝑛1 ,…,𝑛𝑛𝑘𝑘 : ∏𝑚𝑚
𝑗𝑗=1 =� + 𝑘𝑘
+
𝜇𝜇𝑗𝑗 𝜇𝜇2 𝜇𝜇1 𝜇𝜇2
Σ𝑛𝑛𝑗𝑗 =𝑘𝑘
𝜆𝜆𝑘𝑘 1 2 𝜆𝜆 2 1 𝜆𝜆 1 3 −1
𝑘𝑘
+ 𝑘𝑘 �
𝜇𝜇1 𝜇𝜇2 𝜇𝜇1
−1
Let 𝜆𝜆𝑘𝑘 1 = 1 → 𝜆𝜆𝑘𝑘 2 = 1, then 𝑀𝑀
3 𝑘𝑘 = 1.875
𝜆𝜆𝑘𝑘 2
P 0,3 = 𝑀𝑀𝑘𝑘 = 0.0667
𝜇𝜇2 1 2
𝜆𝜆𝑘𝑘 1 𝜆𝜆𝑘𝑘 2
P 1,2 = 𝑀𝑀𝑘𝑘 = 0.1333
𝜇𝜇1 2 𝜇𝜇2 1
𝜆𝜆𝑘𝑘 1 𝜆𝜆𝑘𝑘 2
P 2,1 = 𝑀𝑀𝑘𝑘 = 0.2667
𝜇𝜇 3 𝜇𝜇2
𝜆𝜆𝑘𝑘 11
P 3,0 = 𝑀𝑀𝑘𝑘 = 0.5333
𝜇𝜇1

You might also like