Queuing System
Queuing System
Hours)
1
Contents of the unit
• Characteristics and Structure of Basic Queuing System, Models of
Queuing System, Queuing notation, Single Server and Multiple Server
Queuing Systems, Measurement of Queuing System Performance,
Elementary idea about networks of Queuing with particular emphasis
to computer system, Applications of Queuing system
2
Queuing System
• Introduction: Most systems of interest in a simulation study contain a
process in which there is a demand for services.
• The system can service entities at a rate which is smaller than the rate
at which entities arrive.
• The entities are then said to join waiting line.
• The line where the entities or customers wait is generally known as
queue.
• The combination of all entities in system being served and being
waited for services is called a queuing system
3
Characteristics or elements of queuing system
• In order to model queuing systems, we first need to be a bit more
precise about what constitutes a queuing system.
• The three basic elements common to all queuing systems are:
1. Arrival process or Patterns
2. Service Process or patterns
3. Queuing discipline
4. Calling Population
5. System Capacity
4
Characteristics or elements of queuing system
• Arrival Process or Patterns : Any queuing system must work on
something- customers, parts, patients, orders etc.
• We generally called them as entities or customers.
• Before entities can be processed or subjected to waiting, they must first
enter the system.
• Depending on the environment, entities can arrive smoothly or in an
unpredictable fashion.
• They can arrive one at a time on clumps (eg bus load).
• They can arrive independently or according to some kind of correlation.
5
Characteristics or elements of queuing system
• A special arrival process, which is highly useful for modeling process, is
the Markov arrival process.
• Both of these names refer to the simulation where entities arrive one at
a time and the times between arrivals are exponential random variables.
• This type of arrival process is memory-less, which means that the
likelihood of an arrival within the next ‘t’ minutes is the same no matter
how long it has been since the last arrival.
• Examples where this occurs are phone calls arriving at an exchange,
customers arriving at a fast food restaurant, hits on a web sites and
many others.
6
Characteristics or elements of queuing
system
• Service Process : Once entities have been entered the system they
must be served.
• The physical meaning of “service” depends on the system.
• Customers may go through the checkout process.
• Parts may go through matching.
• Patients may go through medical treatment.
• Orders may be filled. And so on.
• From modeling, standpoint, the operational characteristics of service
matter more than the physical characteristics.
7
Characteristics or elements of queuing system
• Specifically, we care about whether service times are long or short
and whether they are regular or highly variable.
8
Queuing Discipline
• The third required component of a queuing system is a queue in
which entities wait for service.
• The number of customer can wait in a line is called system capacity.
• The simplest case is an unlimited queue which can accommodate any
number of customers.
• It is called system with unlimited capacity.
• But many systems (eg. Phone exchanges, web servers, call centers),
have limits on the number of entities that can be in queue at any
given time.
9
Queuing Discipline
• Arrivals that come when the queue is full are rejected (e.g., customers
get a busy signal when trying to dial into a call center.
• Even if the system does not have strict limit on the queue size, the
logical ordering of customer in a waiting line is called Queuing
discipline and it determines which customer will be chosen for
service.
• We may say that queuing is rule to choose the customer for service
from the waiting line.
• The queuing discipline includes:
10
Queuing Discipline
• FIFO (First in First out): According to this rule, Service is offered on
the basis of arrival time of customer.
• The customer who comes first get the service first.
• So in other words the customer who get the service will be determine
on the basis of longest waiting time.
11
Queuing Discipline
• Last in First out(LIFO): It is usually abbreviated as LIFO, occurs when
service is next offered to the customer that arrived recently or which
have waiting time least.
• In the crowded train the passengers getting in or out from the train is
an example of LIFO
12
Queuing Discipline
• Service in Random Order(SIRO): It means that a random choice is
made between all waiting customers at the time service is offered.
That is, a customer is picked up randomly from the waiting queue for
the service.
13
Queuing Discipline
• Shortest Processing Time (STP):- It means that the customer with
shortest service time will be chosen first for the service.
• The shortest time customer will get the priority in the selection
process.
14
Queuing Discipline
• Priority: A special number is assigned to each customer in the
waiting line and is called priority.
• Then according to this number, the customer is chosen for service
15
Queuing Behavior
• Customer may bunk at joining the queue when it is too long (e.g., cars pass up a
drive through restaurant if there are too many cars already waiting).
• It is called balking
• Customer may also exit the system due to impatience (e.g., customer kept
waiting too long at a bank decide to leave without service) or perishable (e.g.,
samples waiting for testing at a lab spoil after some time period).
• It is called reneging.
• When there is more than line forming for the same service, or server, the action
of moving customer from one time to another line because they think that they
have chosen slow line.
• It is called Jockeying
16
The calling Population
• The population of potential customers, referred to as the calling
population, may be assumed to be finite or infinite.
• For example, consider the personal computers of the employees of a
small company that are supported by an IT staff of three technicians.
• When a computer fails, needs new software, etc, it is attended by one of
the IT staff.
The computers are customers who arrive at the instant they need attention.
The IT staff are the servers who provide repairs, software updates etc.
The calling population is finite and consists of the personal computers at
the company.
17
The calling Population
• In systems with a large population of potential customers, the calling
population is usually assumed to be infinite.
• For such a systems, this assumption usually innocuous and, furthermore,
it might simplify the model.
• Examples of infinite populations include the potential customers of a
restaurant, bank or other similar service facility and also the personal
computers of the employees of a very large company.
• Even though the actual population could be finite but large, it is
generally safe to use infinite population models, provided that the
number of customers being served or waited for service at any given
time is small proportion of the population
18
The calling Population
• The main difference between finite and infinite population models is
how the arrival rate is defined.
• In an infinite population model, the arrival rate is not affected by the
number of customers who have left the calling population and joined
the queuing system.
• When the arrival process is homogeneous over time(there are no rush
hours), the arrival rate is usually assumed to be constant.
• On the other hand, for finite calling population models, the arrival
rate to the queuing system does depend on the number of customers
being served and waiting.
19
The calling Population
• To take an extreme case, suppose that the calling population has one
member, for example, a corporate jet.
• When the corporate jet is being serviced by the team of mechanics who
are on duty 24 hours per day, the arrival rate is zero, because there are
other potential customers (jets) who can arrive at the service facility.
• A more typical example is five hospital patients assigned to a single
nurse.
• When all patients are resting and the nurse is idle, the arrival rate is at its
maximum since any of the patients could call the nurse for assistance in
the next instant.
20
The calling Population
• At those times when all five patients have called for the nurse (four
are waiting for the nurse and one being served) the arrival rate is
zero; that is no arrival is possible until the nurse finishes with a
patient, in which case the patient returns to the calling population
and becomes a potential arrival
21
System Capacity
• In many queuing systems, there is a limit to the number of customers
that may be in the waiting line or system.
• For example, an automatic car wash might have room for only 10 cars
to wait in line to enter the mechanism.
• An arriving customer who finds the system full does not enter but
returns immediately to the calling population.
• Some systems, such as in-person concern ticket sales for students,
may be considered as having unlimited capacity, since there are no
limits on the number of students allowed to wait to purchase tickets.
22
Queuing Notations (Kendall’s Notation)
• We will be frequently using notations for queuing system, called
Kendall’s notation. i.e A|B|c|N|K, where A, B, c, N, K respectively
indicate arrival pattern, service pattern, number of server, system
capacity and Calling population.
• The symbols used for the probability distribution for inter arrival
times and service time are D for deterministic, M for exponential (or
Markov) and Ek for Erlang
• If the capacity Y is not specified, it is taken as infinity, and if calling
population is not specified, it is assumed unlimited or infinite.
23
Queuing Notations (Kendall’s Notation)
• Example:
• a)M|D|2|5|∞ stands for a queuing system having exponential arrival
times, deterministic service, 2 servers, capacity of 5 customers and
infinite population.
• b) if the notation is given as M|D|2 then it means exponential arrival
time, deterministic service time, 2 servers, infinite service capacity
and infinite population
24
Long Run Measures of Performance of
Queuing Systems
• The primary long-run measures of performance of queuing systems
are the long-run time average number of customers in the system (L)
and in the queue (LQ), the long run average time spent in system (w)
and in the queue (wQ) per customer and the server utilization, or
proportion of the time that a server is busy (ρ).
• The term system usually refers to the waiting line plus the service
mechanism, but, in general, can refer to any subsystem of the
queuing system; on the other hand, the term queue refers to the
waiting line alone.
25
Long Run Measures of Performance of
Queuing Systems
• Other measures of performance of interest include the long-run
proportion of customers who are delayed in queue longer than t0 time
units, the long run proportion of customers turned away because of
capacity constraints, and the long-run proportion of time the waiting
line contains more than k0 customers.
26
Single Server Queuing System
• For the case of simplicity, we will assume for the time being, that there is
single queue and only case serving the customers. We make the following
assumptions.
• First-in, First-out(FIFO): Service is provided on the first come, first served
basis
• Random: Arrivals of customers is completely random but at a certain arrival
rate.
• The above conditions are very ideal conditions for any queuing system and
assumptions are made to model the situation mathematically.
• The first condition only means irrespective of customer, one who comes first
is attended first and no priority is given to anyone
27
Measures of Queues
• Given the mean inter arrival time Ta and Mean Service time Ts then
we have
• Arrival rate λ =
• Service rate μ =
28
Time Average Number in System L
29
Time Average Number in System L
Consider a queuing system over a period of time T, and let L(t) denotes the number
of customers in the system at time t.
A simulation is shown in the figure in the next figure.
Let Ti denotes the total time during [0,T] in which the system contained exactly i
customers.
In the figure below, it is seen that T0 = 3, T1 = 12, T2 = 4 and T3=1.
In general .
The time weighted-average number in a system is given by
30
Time Average Number in System L
• For the system above, the time weighted average number in a system is
calculated as = 1/T{
• = [0*3+1*12+2*4+3*1]/20 = 1.15 customers.
• The total area of the rectangles is given by
•
Many queuing systems exhibit a certain kind of long-run stability in terms of their
average performance. For such systems, as time T gets very large, the observed
time –average number in the system approaches a limiting value say L, which is
called the long-run time average numbers in system-that is with probability 1.
31
Average Time Spent in System Per
Customer
• If we simulate a queuing system for some period of time, say T, then we
can record the time each customer spends in the system during [0,T],
say w1, w2,w3,….Wn, where N is the number of arrivals during [0,N].
• The average time spent in system per customer, called the average
system time is given by the ordinary sample average
• =
• For stable systems, as N ∞
• With probability 1, where w is called the long run average system time
32
The Conservation Equation L= λw
• The law says that the average number of customers in the system at
an arbitrary point in time is equal to the average number of arrivals
per time unit, times the average time spent in the system.
• For example, when there is one arrival every 4 time units (on average)
and each arrival spends 4.6 time units in the system (on average), so
at an arbitrary point in time there will be (1/4)*(4.6) = 1.15
customers present (on average).
33
The Conservation Equation L= λw
• Since we have the total system time of all customers in the system is
given by the total area under the number-in-system function L(t), that
is,
• (1)
34
The Conservation Equation L= λw
• This relationship between L ,λ and w is not coincidental, it holds for
almost all queuing systems, or subsystems regardless of the number
of servers, the queue discipline or any other special circumstances.
35
Server Utilization
• Server utilization is the defined as the proportion of time that a sever
is busy.
• Observed server utilization denoted as is defined over a specified
time interval [0,T].
• Long run server utilization is denoted by ρ.
• For systems that exhibit long run stability,
• as T ∞
36
Server Utilization in G|G|1| ∞| ∞ Queue
• Consider any single server queuing system with average arrival rate λ
customer per time unit, average service rate E(s) = 1/μ time units,
and infinite queue capacity and infinite calling population.
• Here E(s) = 1/μ implies that, when busy, the server is working at the
rate μ customers per time unit, on the average; μ is called the service
rate.
• The server alone is a subsystem that can be considered as a queuing
system in itself; hence the conservation equation L= λw can be
applied to the server.
37
Server Utilization in G|G|1| ∞| ∞ Queue
• For stable system, the average arrival rate to the server, say λs, must be
identical to the average arrival rate to the system, λ ( in fact λs≤ λ,
customers cannot be served faster than they arrive, but if λs< λ, the
waiting line would tend to grow in length at an average rate of λ – λs
customers per unit time, so we would have unstable system.
• For the server subsystem, the average system time w = E(s) = 1/μ.
• The actual number of customers in the server system is either 0 or 1.
• In general, for a single server queue, the average number of customers
being served at an arbitrary point in time is equal to server utilization.
• That is, L =
38
Server Utilization in G|G|1| ∞| ∞ Queue
• So we have
• w = 1/μ
• L = λw
• L =
• Combining these results, for the server subsystem, we have
• =
• That is, in a long run server utilization in a single server queue is equal
to the average arrival rate divided by the average service rate.
39
Server Utilization in G|G|1| ∞| ∞ Queue
• For a single server queue to be stable, the arrival rate λ must be less
than the service rate μ.
• That is λ<μ
• or = <1
• If the arrival rate is greater than the service rate (λ>μ), the server will
eventually get further and further behind.
• After a time, the server will always be busy, and the waiting line will
tend to grow in length at an average rate of (λ-μ) customer per time
unit, because departure will be occurring at rate μ per time unit
40
Multiserver Queue M|M|c | ∞| ∞
41
Server Utilization in G|G|c| ∞| ∞ Queue
• Consider a queuing system with c identical servers in parallel.
• If an arriving customer finds more than one server idle, the customer chooses a server
without favoring any particular server.
• Arrivals occur at rate λ from infinite calling population, and each server works at rate μ
customers per time unit.
• For server subsystems in equilibrium, the average number of busy servers say Ls, is
given by
• Ls = λE(s) = { 0≤Ls ≤ c }
• The long run average server utilization is defined by
• =
• And so 0≤ 1. The utilization can be interpreted as the proportion of time an arbitrary
server is busy in the long run
42
Server Utilization in G|G|c| ∞| ∞ Queue
• The maximum service rate of Server Utilization in G|G|c| ∞| ∞
queue system is cμ, which occurs when all servers are busy.
• For the system to be stable, the average arrival rate λ must be less
than the maximum service rate cμ
• That is, the system is stable if and only if
• λ < cμ. Or c>
• If λ >cμ, then arrivals are occurring on the average, faster than the
system can handle them, all servers will be continuously busy and the
waiting line will grow in length at an average rate of (λ –cμ) customers
per time unit. Such a system is unstable
43
Example 1
• Customers arrive at random to a license bureau at a rate of λ = 50
customer per hour. Currently, there are 20 clerks, each serving 5
customers per hour on average.
1. Find sever utilization
2. Average number of busy servers.
3. What is minimum number of servers for the stable system.
44
Solution
• Here arrival rate λ= 50
• Number of server c = 20
• Service rate μ = 5
• Now server utilization = = = 0.5
• And the average number of busy server is
• Ls = = = 10
• Thus, in long run, a typical clerk is busy serving customers only 50 % of the time.
• For the system to be stable, it is necessary for the numbers of servers to satisfy
• c> or c>50/5 = 10.
• Thus, possibilities for the manager to consider include c=11 or c=12 or c=13….
45
Costs in Queuing Problems
• In many queuing situations, costs can be associated with various
aspects of the waiting line or servers.
• Suppose that the system incurs a cost for each customer in the queue,
say at a rate of $10 per hour per customer.
• If customer j spends wjQ hours in the queue then
• is the total cost of N customers who arrive during the simulation.
• Thus, the average cost per customer is
• = $10.
46
Costs in Queuing Problems
• If customers per hour arrive (on the average), the average cost per
hour is
• ( )*() = ($10. )/hour =
47
Single Server Queues with Poisson’s Arrival and Unlimited
Capacity : M|G|1
• Suppose that service times mean and variance σ2 and that there is
one server.
• If ρ = <1, then the M|G|1 queue has a steady-state probability
distribution with steady state characteristics as given in the following
table.
• In general, there is no simple expression for the steady-state
probabilities P0, P1,P2,….
• When λ<μ, the quantity ρ= is the server utilization or long –run
proportion of the time the server is busy.
48
Single Server Queues with Poisson’s
Arrival and Unlimited Capacity : M|G|1
• Here 1-P0 = ρ can be interpreted as the steady state probability that
the system contains one or more customers.
• And L-LQ = ρ is the time-average number of customers being served
49
Single Server Queues with Poisson’s
Arrival and Unlimited Capacity : M|G|1
50
Example 2
• Customers arrive at a walk in shoe repair shop apparently at random.
• It is assumed that arrivals occur according to a Poisson process at rate
λ =1.5 per hour. Observation shows that shoe repair times by the
single worker take an average time of 30 minutes with a standard
deviation of 20 minutes.
• Find server utilization
• Time average number of customers in the shop
51
Solution
• Here arrival rate λ = 1.5
• Service rate μ = 2
• Server utilization ρ = λ/ μ = 1.5/2 = 0.75
• Variance σ2 = (20/60)2 = 1/9
• Time average number of customers in the queue L = ρ+
• L = 0.75+ = 2.375
52
Example 3
• There are two workers competing for a job. Able claims that an
average service time that is faster than Baker’s but Baker claims to be
more consistent, even if not as fast.
• The arrivals occurs according to a Poisson process at the rate λ= 2 per
hour (1/30 per minute). Able’s service statistics are an average service
time of 24 minutes, but a standard deviation of only 20 minutes.
Baker’s service statistics are an average service time of 25 minutes
but a standard deviation of only 2 minutes.
• If the average length of queue is the criterion for hiring, which worker
should be hired?
53
Solution
• For Able
• λ = 1/30 per minute
• μ = 1/24
• ρ = λ/ μ = 0.80
• σ2 = 400
• LQ = = 2.71
• For Baker
• λ = 1/30 per minute
• μ = 1/25
• ρ = λ/ μ = 0.83
• σ2 = 4
• LQ = = 2.05
• Since average queue length for Baker is shorted, he will be hired
54
The M|M|1 Queue
• Suppose that service times in an M|M|1 queue are exponentially
distributed with mean 1/μ; then the variance as given by the equation
E(X) = = and V(x) = is σ2 =
• The mean and standard deviation of the exponential distribution are
equal, so the M|M|1 queue will often be a useful approximate model
when service times have standard deviation approximately equal to
their mean.
• The steady state parameters are as follows:
55
The M|M|1 Queue
56
Example
• Suppose that the interarrival times and service times at a single-chair
hair styling shop have been shown to be exponentially distributed.
• The value of λ and μ are 2 and 3 per hour respectively.
1. Find server utilization
2. Probabilities of being no, single customer, two customers, three and
more than four customers in the shop
3. Server idle probability
4. Time average number of customers in the system
5. Average time of customer spends in the queue
57
Solution
58
Solution
59
Example 4
60
Example 5
61
Example 6
• Customers arrive in a bank according to Poisson’s process with mean
inter arrival time of 10 minutes. Customers spend an average of 5
minutes on single available counter and leave.
a. What is the probability that a customers will not have to wait at the
counter?
b. What is the expected number of customers in the bank?
c. How much time can a customer expect to spend in the bank?
62
Solution:
• We will take an hour an the unit of time. Thus, λ = 6 customers/hour
• μ = 12 customers/hour
• The customer will not have to wait if there are no customers in the
bank.
• p0 = 1- λ/μ = 1-6/12 = 0.5
• Expected numbers of customers in the bank are given by
• Ls = λ/(μ -λ) = 6(12-6) = 1
• Expected time to be spent in the back is given by
• Ws = 1/(μ-λ) = 1/6 = 10 minutes
63
Example 7
• At the banking, people come in queue. Arrival rate of customers is
1/min. It takes at the average of 30 seconds to take the token. If a
customer arrives 5 minutes before the bank closed and if he takes
exactly 4.5 minutes to reach the correct counter after he take a token,
can the customer expects to take banking service?
• Solution: A minute is used as unit of time. Since token takes 30
seconds, this means, two customers enter the bank per minute, that
is service rate is 2 per minute.
• Therefore,
• λ = 1 arrival/min
• μ = 2 arrivals/min
64
Ws = waiting time in the system = 1/(μ-λ) = 1 minutes
• And if he takes exactly 4.5 minutes to reach to the correct after he
take a token, so bank is closed because 4.5+1 = 5.5
65
Network Queuing
• Network queuing is a very important application of queuing theory.
The term ‘network of queue’ describes a situation where the input
from one queue is the output for one or more others.
• This is true in many situations from telecommunications to a PC.
• Below is a description of some of the broad applications of network
queuing.
66
Network Queuing
• Computer Networks
• Network Communication
• Broadcasting
67
Computer Networks
• A simple example of network queuing is the central server network.
• This consists of a CPU (central proceeding unit), storage units it can
access and input devices to access it.
• The tasks the CPU performs are placed on queue on different criteria.
• Also, the storage units could have their own individual queues
68
Network Communication
• There are two board methods connected to network communication
• Circuit Switching
• Packet Switching
69
Network Communication
• Circuit Switching: When a call is made from a source to a destination
it must traverse several nodes along the way.
• Which nodes it traverses is determined by the availability of free
channels along the way.
• Each node has a queue for calls requesting a channel.
• Once a channel has been opened the call can progress to the next
node and wait for a channel there.
• The channel remains open until the source or destination (once
reached) closes the call
70
Network Communication
• Packet Switching : Message are transmitted through intermediate
stages and the route a message takes depends entirely upon the
current load on the system.
• The route allocation is dynamic.
• Each state requires a random amount of time reflecting the length of
the queue at that stage
71
Broadcasting
• Radio Communication
• Digital Communication
72
Broadcasting
• Radio Communication: Considering the nodes as transmitters / receivers
you can treat each as having a queue for their channels.
• Without going into great details of the various systems used; it is always
necessary to consider the fact that to open a channel you must check to
see if the two adjacent channels are also free as interference blocks
transmissions
• When the channels are not free it may be necessary to re-allocate
communications that already have channels to make room
73
Broadcasting
• This is done on the basis of time slots.
• For a given communication link it could have several or all slots filled
no interference would take place making allocation far simpler.
74
TU Questions
• What are the characteristics of queuing system? What are the various
performance measures in single server (M|M|1) queuing system (5+5)
• What are the elements of queuing system?
• Define queuing discipline? Describe different types of queuing
discipline with example.
• Define traffic intensity and server utilization? Write down the
Kendall’s notation for queuing system with example.
• What do you understand by queue and queuing discipline. An office
works for 5 days, 8 hours per day and receives 1200 telephone call in
the week. Calculate the mean arrival rate and mean Interarrival time
of the calls.
75
TU Questions
76