Lec - 05 Queuing Theory
Lec - 05 Queuing Theory
1
Queuing System
🞂 Waiting for service is part of our daily life. We queue up for
🞂 Bus, check out counter etc.
2
Queuing System
🞂 A queuing system is a facility consisting of one or several servers designed to perform
certain tasks or process certain jobs and a queue of jobs waiting to be processed.
🞂 an internet service provider whose customers connect to the internet, browse, and disconnect;
3
Queuing System
🞂 Main components
4
Queuing System - Input process
🞂 Usually called the arrival process.
🞂 Arrivals are called customers.
🞂 We assume that no more than one arrival can occur at a given instant.
🞂 If more than one arrival can occur at a given instant, we say that bulk arrivals are
allowed.
🞂 Models in which arrivals are drawn from a small population are called finite source
models.
🞂 If a customer arrives but fails to enter the system, we say that the customer has balked.
5
Queuing System - Output process
🞂 To describe the output process of a queuing system, we usually specify a probability
distribution – the service time distribution – which governs a customer’s service time.
🞂 Two arrangements of servers:
🞂 Servers are in parallel if all server provide the same type of service and a customer need only
pass through one server to complete service.
🞂 Servers are in series if a customer must pass through several servers before completing service.
6
Queuing System - Queue discipline
🞂 Describes the method used to determine the order in which customers are served.
🞂 The most common - FCFS discipline (first come, first served), served in order of their
arrival.
🞂 LCFS discipline (last come, first served), the most recent arrivals are the first to enter
service.
🞂 Customer is randomly chosen from waiting line - SIRO discipline (service in random
order).
🞂 Priority queuing disciplines - classifies each arrival into one of several categories.
🞂 Each category is then given a priority level, and within each priority level served on an FCFS
basis.
7
Modeling Arrival Processes
🞂 We define ti to be the time at which the ith customer arrives.
🞂 we define Ti = ti+1 - ti to be the ith interarrival time.
🞂 In modeling the arrival process we assume that the Ti’s are independent, continuous random
variables described by A having a density function a(t).
🞂 The assumption that each interarrival time is governed by the same random variable implies
that the distribution of arrivals is independent of the time of day or the day of the week.
🞂 This is the assumption of stationary interarrival times.
🞂 Stationary-(whose distribution characteristics do not change over time)
8
Modeling Arrival Processes
🞂 The independence assumption means, for example, that the value of T 2 has no effect on the
value of T3, T4, or any later Ti
🞂 Stationary interarrival ties is often unrealistic, but we may often approximate reality by
breaking the time of day into segments.
🞂 A negative interarrival time is impossible. This allows us to write
9
Modeling Arrival Processes
🞂 Lemma 1: If A has an exponential distribution, then for all nonnegative values of t and
h,
(5)
🞂 For example, if h=4, then (5) yields, for t=5, t=3, t=2, and t=0
🞂 For reasons that become apparent, a density that satisfies the equation is said to have the
no-memory property.
🞂 The no-memory property of the exponential distribution is important because it implies
that if we want to know the probability distribution of the time until the next arrival,
then it does not matter how long it has been since the last arrival.
10
Modeling the Service Process
🞂 We assume that the service times of different customers are independent random variables and that each
customer’s service time is governed by a random variable S having a density function s(t).
🞂 We let 1/µ be then mean service time for a customer.
🞂 so µ is service rate.
🞂 As with interarrival times, we hope that service times can be accurately modeled as exponential random
variables
🞂 Unfortunately, actual service times may not be consistent with the no-memory property.
🞂 For this reason, we often assume that s(t) is an Erlang distribution with shape parameters k and rate
parameter μ.
13
The Kendall-Lee Notation for Queuing Systems
🞂 The first characteristic specifies the nature of the arrival process. The following
standard abbreviations are used:
M = Interarrival times are independent, identically distributed (iid) having an exponential
distribution.
D = Interarrival times are iid and deterministic
Ek = Interarrival times are iid Erlangs with shape parameter k.
GI = Interarrival times are iid and governed by some general distribution
14
The Kendall-Lee Notation for Queuing Systems
🞂 The second characteristic specifies the nature of the service times:
M = Service times are iid and exponentially distributed
D = Service times are iid and deterministic
Ek = Service times are iid Erlangs with shape parameter k.
G = Service times are iid and governed by some general distribution
15
The Kendall-Lee Notation for Queuing Systems
🞂 The third characteristic is the number of parallel servers.
🞂 The fourth characteristic describes the queue discipline:
🞂 FCFS = First come, first served
🞂 LCFS = Last come, first served
🞂 SIRO = Service in random order
🞂 The fifth characteristic specifies the maximum allowable number of customers in the
system.
🞂 The sixth characteristic gives the size of the population from which customers are
drawn.
16
The Kendall-Lee Notation for Queuing Systems
🞂 In many important models 4/5/6 is GD/∞/∞. If this is the case, then 4/5/6 is often
omitted.
🞂 M/E2/4/FCFS/10/∞
🞂 might represent a health clinic with 4 doctors,
🞂 exponential interarrival times,
🞂 two-phase Erlang service times,
🞂 an FCFS queue discipline, and
🞂 a total capacity of 10 patients.
17
Birth-Death Processes
18
Birth-Death Processes
🞂 We will use it to answer questions about several different types of queuing systems.
🞂 Number of people present in any queuing system at time t to be the state of the queuing
systems at time t.
🞂 We call πj the steady state, or equilibrium probability, of state j.
🞂 The behavior of Pij(t) before the steady state is reached is called the transient behavior of the
queuing system.
🞂 A birth-death process is a continuous-time stochastic process for which the system’s state at
any time is a nonnegative integer.
Pij(t) = transition probability that the system is in state j at time t starting from state i, at t=0
Pij(t) =the probability that j people will be present in the queuing system at time
t, given that at time 0, i people are present
19
Birth-Death Processes
You may think it like DTMC, but better not to These are transition
probability
1-λ1-μ1 1-λ2-μ2 1-λj - μj
1-λ0
λ0 λ1 λ2 λj-1 λj
0 1 2 …. j ….
μ1 μ2 μ3 μj μj+1
These are transition
Sometimes, simplified to the following one rate in BD process
0 1 2 …. 0
j-1 j j+1 ….
μ1 μ2 μ3 μj-1 μj μj+1
20
Laws of Motion for Birth-Death
🞂 Law 1
🞂 With probability λjΔt+o(Δt), a birth occurs between time t and time t+Δt.
🞂 A birth increases the system state by 1, to j+1.
🞂 The variable λj is called the instantaneous birth rate in state j.
🞂 In most queuing systems, a birth is simply an arrival.
🞂 Law 2
🞂 With probability µjΔt+o(Δt), a death occurs between time t and time t + Δt. A death decreases the
system state by 1, to j-1.
🞂 The variable µj is the death rate in state j.
🞂 In most queuing systems, a death is a service completion.
🞂 Note that µ0 = 0 must hold, or a negative state could occur.
🞂 Law 3
🞂 Births and deaths are independent of each other.
21
Birth-Death Processes
🞂 M/M/1/FCFS/∞/∞ queuing system in which interarrival times are exponential with parameter λ and
service times are exponentially distributed with parameter μ.
🞂 If the state (number of people present) at time t is j, then the no-memory property of the exponential
distribution implies that the probability of a birth during the time interval [t,t+ Δt] will not depend on
how long the system has been in state j.
🞂 Thus, may be determined as if an arrival had just occurred at time t.
🞂 Then the probability of a birth occurring during [t,t+ Δt] is
22
M/M/1/FCFS/∞/∞ queuing system
23
M/M/3/FCFS/∞/∞ queuing system
🞂 Interarrival times are exponential with λ = 4 and service times are exponential with μ=5.
• If either interarrival times or service times are nonexponential, then the birth–death
process model is not appropriate.
• Suppose, for example, that service times are not exponential, and we are
considering an M/G/1/FCFS/∞/∞ queuing system.
• Since the service times for an M/G/1/FCFS/∞/∞ system may be nonexponential,
the probability that a death (service completion) occurs between t and t+ Δt will
depend on the time since the last service completion.
• This violates law 2, so we cannot model an M/G/1/FCFS/∞/∞ system as a birth–
death process.
24
Birth-Death Processes
λ0 λ1 λ2 λj-2 λj-1 λj λj+1
0 1 2 …. 0
j-1 j j+1 ….
μ1 μ2 μ3 μj-1 μj μj+1
Or simply
25
Birth-Death Processes – steady state probabilities
λ0 λ1 λ2 λj-2 λj-1 λj λj+1
0 1 2 …. 0
j-1 j j+1 ….
μ1 μ2 μ3 μj-1 μj μj+1
0 1 2 …. 0
j-1 j j+1 ….
μ1 μ2 μ3 μj-1 μj μj+1
For j=0,
27
Steady-State Probabilities for Birth-Death Processes
For t→∞,
called steady state probability
🞂 The above equations are often called the flow balance equations, or conservation of flow
equations, for a birth-death process.
0 1 2 …. 0
j-1 j j+1 ….
μ1 μ2 μ3 μj-1 μj μj+1
29
Solution of Balance Eq.
30
Solution of Balance Eq.
🞂 If is finite, we can solve for π0:
31
Solution of Balance Eq.
32
Flow balance Eqn of B-D process
🞂 Global eqn
🞂 Local eqn
33
Birth Death Process - Summary
λ0 λ1 λ2 λj-2 λj-1 λj λj+1
0 1 2 …. 0
j-1 j j+1 ….
μ1 μ2 μ3 μj-1 μj μj+1
34
M/M/1 Queuing System
35
M/M/1/GD/∞/∞ Queuing System
λ λ λ λ λ λ λ
0 1 2 …. 0
j-1 j j+1 ….
μ μ μ μ μ μ
Here, λj = λ j= 0, 1, 2, … Be remember
μ0 = 0 • State represents no.
μj = μ j= 1, 2, … of customer in the q
36
M/M/1/GD/∞/∞ Queuing System
λ λ λ λ λ λ λ
0 1 2 …. 0
j-1 j j+1 ….
μ μ μ μ μ μ
38
M/M/1/GD/∞/∞ Queuing System
🞂 The steady state parameters we are interested in
🞂 W = average time a customer spends in the system
= average response time
🞂 Wq = average time a customer spends in line
🞂 Ws = average time a customer spends in service
🞂 W = Wq +Ws
Little’s Queuing Formula L = λeff W
🞂 For any queuing system in which a steady-state distribution exists, the following relations hold:
L = λW
Lq = λWq
Ls = λWs
🞂 Utilization = s′/s
39
M/M/1/GD/∞/∞ Queuing System
🞂 Derivation of L
🞂 We know that E(X) = ∑[x f(x)] and P(X=x) =f(x)
🞂 X = no. of customer in the system during steady state
🞂 X can have values j = 0, 1, 2, … with probability πj
40
M/M/1/GD/∞/∞ Queuing System
🞂 Derivation of L
🞂 Another way
41
M/M/1/GD/∞/∞ Queuing System
🞂 Derivation of Lq
🞂 Let, the system in state j=0,1,2,… with probability πj
🞂 i.e. there are j customer in the system now
🞂 Since only 1 server, there are j-1 customer is waiting in queue
42
M/M/1/GD/∞/∞ Queuing System
🞂 Derivation of LS
= s′
= s′
43
M/M/1/GD/∞/∞ Queuing System
44
M/M/1/GD/∞/∞ Queuing System
45
M/M/1/GD/∞/∞ Queuing System
🞂 Example 4 (Winston)
🞂 Suppose that all car owners fill up when their tanks are exactly half full.
🞂 At the present time, an average of 7.5 customers per hour arrive at a single-pump gas
station.
🞂 It takes an average of 4 minutes to service a car.
🞂 Assume that interarrival and service times are both exponential.
1. What is the probability that the teller is idle?
2. For the present situation, compute L , Lq and W, Wq.
46
M/M/1/GD/∞/∞ Queuing System
🞂
47
Solutions
🞂 We have an M/M/1/GD/∞/∞ system with
λ = 7.5 cars per hour µ = 60/4=15 cars per hour.
ρ = 7.5/15 = 0.5
1. Idle probability π0 = 1 − ρ = 0.5
🞂 Hence, in this situation, everything is under control, and long lines appear to be unlikely.
48
Solutions
3. We now have an M/M/1/GD/∞/∞ system with
λ = 2*7.5 =15 cars per hour
µ = 60*3/10=18 cars per hour.
ρ = 15/18 =5/6