You are on page 1of 7

Lecture 25

What is Queuing Theory?


BE (CS)
Spring 2022 Semester ➢ Queuing theory
▪ Study that quantifies the phenomenon of waiting in
lines using representative measures of performance,
CS-438: Computer Systems Modeling
such as
o average queue length,
o average waiting time in queue, and
Lectures 25-27 o average service time.
Basic Structure Of Queuing Models ▪ It uses queuing models to represent the various types of
queuing systems that arise in practice.
▪ Advantages of queuing models
Dr Syed Zaffar Qasim o Formulas exist for each model
Assistant Professor (CIS)
o very helpful for operating a queuing system in the
1 most effective way. 2

The Basic Queuing Process


What is Queuing Theory?
▪ Customers requiring service are generated over time by
▪ The models enable finding an appropriate balance an input source.
between the cost of service and the amount of waiting.
o Providing too much service capacity to operate the
system involves excessive costs.
o But not providing enough service capacity results in
excessive waiting and all its unfortunate Fig 1: The basic queuing process
consequences.
▪ These customers enter the queuing system and join a
▪ The operating characteristics of queuing systems are
queue.
determined largely by two statistical properties,
namely, ▪ The required service is performed for the customer by
the service mechanism after which the customer leaves
o the probability distribution of inter-arrival times and
the queuing system.
o the probability distribution of service times.
▪ At certain times, a member of the queue is selected for
3
service by some rule known as the queue discipline.
4

CSM (CS-438) 1
Input Source (Calling Population) Input Source (Calling Population)

▪ Calling population: population from which ▪ The finite case is more difficult analytically
arrivals come. because
▪ One characteristic of the input source is its size. o the number of users in the queuing system
o total number of distinct potential customers affects the number of potential users outside
that might require service from time to time. the system at any time.
▪ The size may be assumed to be either infinite or ▪ However, the finite assumption must be made if
finite.
o the rate at which the input source generates
▪ An infinite source is forever abundant (e.g., calls new users is significantly affected by the
arriving at a telephone exchange). number of users in the queuing system.
▪ Because the calculations are far easier for the
▪ The statistical pattern by which customers are
infinite case, this assumption often is made even
when the actual size is some relatively large finite generated over time must also be specified.
number. 5 6

Input Source (Calling Population) Queuing Behavior


▪ The common assumption: Poisson process; i.e.,
o the number of customers generated in a given time ▪ The queuing behavior of customers plays a role
has a Poisson distribution. in waiting-line analysis.
o Arrivals to the queuing system occur randomly but
at a certain fixed mean rate, regardless of how many ▪ Human customers may jockey from one queue
customers already are there to another in the hope of reducing waiting
o so the size of the input source is infinite. time.
▪ An equivalent assumption: the probability ▪ They may also balk from joining a queue
distribution of the time between consecutive altogether because of anticipated long delay, or
arrivals is an exponential distribution. ▪ They may renege from a queue because they
have been waiting too long.

7
8

CSM (CS-438) 2
Queue
Queue Discipline
▪ The queue is where customers wait before being
served. The order in which members are selected from a
▪ A queue is characterized by the maximum queue
permissible number of customers that it can ▪ An important factor in the analysis of queuing
contain. models.
▪ Queues are called infinite or finite, according to ▪ First-come-first-served (FCFS) usually is assumed by
whether this number is infinite or finite. queuing models, unless stated otherwise.
▪ The assumption of an infinite queue is the standard ▪ Other disciplines include Last Come, First Served
(LCFS) and Service In Random Order (SIRO).
one for most queuing models.
▪ Customers may also be selected from the queue based
▪ However, for queuing systems where this upper
on some order of priority.
bound is small enough that it actually would be
▪ For example, rush jobs at a shop are processed ahead
reached with some frequency, it becomes
of regular jobs.
necessary to assume a finite queue. 9 10

Service Mechanism
▪ The service mechanism consists of Service Mechanism
o one or more service facilities,
▪ Service time (or holding time): The time elapsed from
o each of which contains one or more parallel service
the commencement of service to its completion for a
channels, called servers.
customer at a service facility.
▪ If there is more than one service facility, the customer
▪ The service-time distribution that is most frequently
may receive service from a sequence of these (service
assumed in practice
channels in series).
o (largely because it is far more tractable than any
▪ At a given facility, the customer enters one of the parallel
other)
service channels and is completely serviced by that
server. o is the exponential distribution.
▪ A queuing model must specify the arrangement of the ▪ Other important service-time distributions are
facilities and the number of servers (parallel channels) at o the degenerate distribution (constant service time)
each one. and
▪ Most elementary models assume one service facility with o the Erlang (gamma) distribution.
either one server or a finite number of servers. 11 12

CSM (CS-438) 3
Cost-based queuing decision model Lecture 26
➢ Cost optimization model: we seek the minimization An Elementary Queuing Process
of the sum of two costs:- ▪ Queuing theory has been applied to many different types
o the cost of offering the service and the of waiting-line situations.
o cost of waiting.
▪ The most prevalent type is the following:-
▪ Fig 2 depicts a typical cost model (in Rs per unit time).
▪ A single waiting line (which may be empty at times)
forms in front of a single service facility, within which
are stationed one or more servers (fig 3).

Fig 2 Fig 3: An elementary


queuing system

▪ The main obstacle: difficulty of obtaining reliable ▪ Each customer generated by an input source is serviced
estimates of the cost of waiting, particularly when by one of the servers, perhaps after some waiting in the
human behavior is involved. 13
queue (waiting line). 14

An Elementary Queuing Process An Elementary Queuing Process


▪ A server can be a human, a machine, a vehicle, an
electronic device, etc. ▪ It is not necessary that there actually be a physical
▪ By the same token, the customers in the waiting line can waiting line forming in front of a physical structure
be people, computer jobs in a queue. that constitutes the service facility.
▪ For example, they may be items waiting for a certain ▪ The members of the queue may instead be scattered
operation by a given type of machine, or they may be throughout an area, waiting for a server to come to
cars waiting in front of a tollbooth. them, e.g., machines waiting to be repaired.
▪ The server or group of servers assigned to a given
area constitutes the service facility for that area.

15 16

CSM (CS-438) 4
An Elementary Queuing Process
▪ Many of the models further assume that An Elementary Queuing Process
o all inter-arrival times are independent and identically
distributed and that ▪ For example, the M/M/s model assumes that
o all service times are independent and identically o both inter-arrival times and service times have an
distributed. exponential distribution and that
▪ Such models conventionally are labeled as follows:- o the number of servers is s (any positive integer).
▪ The M/G/1 model assumes that inter-arrival times
have an exponential distribution,
o but it places no restriction on what the
o where M = exponential distribution (Markovian), , distribution of service times must be,
o D = degenerate distribution (constant times), o whereas the number of servers is restricted to be
o Ek = Erlang distribution (shape parameter = k), exactly 1.
o G = general distribution (any arbitrary distribution
allowed). 17 18

Terminology and Notation Terminology and Notation

▪ Unless otherwise noted, the following standard 5. n = mean arrival rate (expected number of
terminology and notation will be used:- arrivals per unit time) of new jobs when n jobs are
in system.
1. State of system n(t) = number of jobs in queuing
system at time t (t ≥ 0). 7. µn = mean service rate for overall system
(expected number of jobs completing service per
2. Queue length = number of jobs waiting for
unit time) when n jobs are in system.
service to begin = state of system minus number
of jobs being served. ▪ When n is a constant for all n, this constant is
denoted by .
3. Pn(t) = probability of exactly n jobs in queuing
system at time t, given number at time 0. ▪ When the mean service rate per busy server is a
constant for all n ≥ 1, this constant is denoted by µ.
4. s = number of servers (parallel service channels)
in queuing system.

19 20

CSM (CS-438) 5
Terminology and Notation Lecture 27
Terminology and Notation
▪ (In this case, µn = s µ when n ≥ s, that is, when all s servers
are busy.)
▪ Certain notation also is required to describe steady-
▪ Under these circumstances, 1/ and 1/µ are the expected state results.
inter-arrival time and the expected service time, respectively.
▪ Also,  =/(sµ) is the utilization factor for the service ▪ When a queuing system has recently begun
facility, i.e., operation,
o the expected fraction of time the individual servers are o the state of the system (no. of jobs in the system)
busy, will be greatly affected
o because 1/(sµ) represents the fraction of the system’s ❖by the initial state and
service capacity (sµ) that is being utilized on the average
❖by the time that has since elapsed.
by some arriving customer.
▪ The system is said to be in a transient condition.

21 22

Terminology and Notation


Terminology and Notation
▪ The following notation assumes that the system is in a
▪ However, after sufficient time has elapsed, the steady-state condition:
state of the system becomes essentially
independent of the initial state and the elapsed
time (except under unusual circumstances).
▪ The system has now essentially reached a steady-
state condition, where the probability
distribution of the state of the system remains the
same (the steady-state or stationary distribution)
over time.
▪ Queuing theory has tended to focus largely on the
steady-state condition.

23 24

CSM (CS-438) 6
Relationships between L, W, Lq, and Wq Relationships between L, W, Lq, and Wq
▪ Now assume that the mean service time is a constant,
▪ Assume that n is a constant  for all n.
1/µ for all n ≥ 1.
▪ It has been proved that in a steady-state queuing
process, ▪ It then follows that
L = W ▪ These relationships are extremely important because
▪ Because John D. C. Little provided the first rigorous o all four fundamental quantities: L, W, Lq, and Wq
proof, this equation sometimes is referred to as Little’s can be immediately determined
formula. o as soon as one is found analytically.
▪ Furthermore, the same proof also shows that ▪ This situation is fortunate because
Lq = Wq o some of these quantities often are much easier to
▪ If the n are not equal, then  can be replaced in these find than others
equations by 𝝀,ത the average arrival rate over the long o when a queuing model is solved from basic
run. principles.

25 26

Relationships between L, W, Lq, and Wq

Problem
Suppose that statistical analysis shows that average
arrival and service rates in a database server are 20
and 25 per secs. Also average number jobs in a
queue is estimated as 5. Compute the average
waiting time (in queue), average waiting time (in
system) and average number of jobs in the system.

27

CSM (CS-438) 7

You might also like