4 Queuing System Ioenotes

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

Queuing System

By
y
Prof. S. Shakya

1
Simulation of Queuing Systems

Introduction
 Waiting line queues are one of the most important areas, where
the technique of simulation has been extensively employed.
 The waiting lines or queues are a common site in real life life.
 People at railway ticket window, vehicles at a petrol pump or at a
traffic signal, workers at a tool crib, products at a machining
center television sets at a repair shop are a few examples of
center,
waiting lines.

2
Simulation of Queuing Systems

 The waiting line situations arise, either because,


-There is too much demand on the service facility so
that the customers or entities have no wait for
getting service, or
-There is too less demand, in which case the service
f ilit h
facility have tto waitit ffor th
the entities
titi
 The objective in the analysis of queuing situations is
to balance the waiting time and idle time time, so as to
keep the total cost at minimum.

3
Simulation of Queuing Systems

 The queuing theory its development to an


engineer A.K.Earlang, who in 1920, studied
waiting line queues of telephone calls in
C
Copenhagen,
h D
Denmark.
k
 The problem was that during the busy period,
t l h
telephone operators
t were unable
bl tto h
handle
dl
the calls, there was too much waiting time,
which resulted in customer dissatisfaction
dissatisfaction.

4
State Variables

queue customer
server

State:
 InTheAir: number of aircraft either landing or
waiting to land
 OnTheGround: number of landed aircraft
 RunwayFree: Boolean, true if runway available 5
Discrete Event Simulation Computation
example: air traffic at an airport
events: aircraft arrival, landing, departure

arrival
schedules processed event
8:00 departure arrival
schedules 9:15 9:30 current event
landed
8:05 unprocessed event

simulation time

 Events that have been scheduled, but have not been


simulated (processed) yet are stored in a pending
event list
6
 Events are processed in time stamp order; why?
Queuing System

 Elements of Queuing Systems

7
Queuing System
 Population of Customers or calling source can be
considered either limited (closed systems) or unlimited
(open systems).
 Unlimited population represents a theoretical model of
systems with a large number of possible customers (a
bank on a busy street, a motorway petrol station).
 Example of a limited population may be a number of
processes to be run (served) by a computer or a certain
number of machines to be repaired by a service man.
 It is necessary to take the term "customer" very generally.
 Customers may be people
people, machines of various nature
nature,
computer processes, telephone calls, etc.

8
Queuing System

 Arrival defines the way customers enter the


system.
 Mostly the arrivals are random with random
intervals between two adjacent arrivals.
 Typically the arrival is described by a random
distribution of intervals also called Arrival
Pattern.
Pattern

9
Queuing System

 Queue or waiting line represents a certain number


of customers waiting for service (of course the
queue may be empty).
 Typically
yp y the customer beingg served is considered
not to be in the queue. Sometimes the customers
form a queue literally (people waiting in a line for a
bank teller).
)
 Sometimes the queue is an abstraction (planes
waiting for a runway to land).
 There are two important properties of a queue:
Maximum Size and Queuing Discipline.

10
Queuing System

 Maximum Queue Size (also called System


capacity) is the maximum number of customers that
may wait in the queue (plus the one(s) being
served).
d)
 Queue is always limited, but some theoretical
models assume an unlimited queue length
length.
 If the queue length is limited, some customers are
forced to renounce without being served

11
Applications of Queuing Theory
 Telecommunications
 Traffic control
 Determining the sequence of computer
operations
 Predicting computer performance
 Health services (eg. control of hospital bed
assignments)
 Ai
Airportt traffic,
t ffi airline
i li titicket
k t sales
l
 Layout of manufacturing systems.

12
Example application of queuing theory

 In many retail stores and banks


 multiple line/multiple checkout system  a
queuing
q g system
y where customers wait for the next
available cashier
 We can prove using queuing theory that :
throughput improves increases when queues are
used instead of separate lines

13
Example application of queuing theory

14
Queuing theory for studying networks

 View network as collections of queues


 FIFO data-structures
 Queuingg theoryyp
provides p
probabilistic
analysis of these queues
 Examples:
 Average length
 Average waiting time
 Probability queue is at a certain length
 Probability a packet will be lost

15
Model Queuing System
Queuing System

Queue Server
Queuing System Server System
 Use Queuing models to
 Describe the behavior of queuing systems
 Evaluate system performance

16
System Configuration
Servers

Customers

Single Queue Configuration

17
Characteristics of queuing systems

 Arrival Process
 The distribution that determines how the tasks
arrives in the system.
y
 Service Process
 The distribution that determines the task
processing time
 Number of Servers
 Total number of servers available to process the
tasks

18
Queuing System
 Queuing Discipline represents the way the queue is organized
(r les of inserting and remo
(rules removing
ing ccustomers
stomers to/from the q
queue).
e e)
There are these ways:
1) FIFO (First In First Out) also called FCFS (First Come First
Serve)) - orderlyy queue.
q
2) LIFO (Last In First Out) also called LCFS (Last Come First Serve)
- stack.
3) SIRO (Serve In Random Order).
4) Priority Queue, that may be viewed as a number of queues for
various priorities.
5) Many other more complex queuing methods that typically change
the customer
customer’ss position in the queue according to the time spent
already in the queue, expected service duration, and/or priority.
These methods are typical for computer multi-access systems

19
Queuing System

 Most q quantitative p
parameters ((like average
g q queue
length, average time spent in the system) do not
depend on the queuing discipline.
 That’ss why most models either do not take the
That
queuing discipline into account at all or assume the
normal FIFO queue.
 In fact the only parameter that depends on the
queuing discipline is the variance (or standard
deviation) of the waiting time
time. There is this important
rule (that may be used for example to verify results
of a simulation experiment):

20
Queuing System
 The two extreme values of the waiting time variance are for the
FIFO queue
q e e (minimum)
(minim m) and the LIFO queue
q e e (maximum).
(ma im m)
 Theoretical models (without priorities) assume only one queue.
 This is not considered as a limiting factor because practical
systems with more queues (bank with several tellers with
separate queues) may be viewed as a system with one queue,
because the customers always select the shortest queue.
 Of course, it is assumed that the customers leave after being
served.
d
 Systems with more queues (and more servers) where the
customers may be served more times are called Queuing
Networks.

21
Queuing System
 Service represents some activity that takes time and
that the customers are waiting for. Again take it very
generally.
generally
 It may be a real service carried on persons or
machines, but it may be a CPU time slice, connection
createdd for
f a telephone
l h call,
ll being
b i shot
h down
d for
f an
enemy plane, etc. Typically a service takes random
time.
 Theoretical models are based on random distribution
of service duration also called Service Pattern.
 Another important parameter is the number of
servers. Systems with one server only are called
Single Channel Systems, systems with more servers
are called
ll d Multi
M lti Ch
Channell Systems
S t
22
Queuing System

 p represents
Output p the way
y customers leave the
system.
 Output is mostly ignored by theoretical models, but
sometimes the customers leaving the server enter
the queue again ("round robin" time-sharing
systems).
 Queuing Theory is a collection of mathematical
models of various queuing systems that take as
inputs parameters of the above elements and that
provide quantitative parameters describing the
system performance

23
Analysis of M/M/1 queue

 Given:
• : Arrival rate of jobs (packets on input link)
• : Service rate of the server (output link)
 Solve:
 L: average number in queuing system
 Lq average number in the queue
 W: average waiting time in whole system
 Wq average waiting time in the queue

24
M/M/1 queue model

L
Lq



1
Wq 

25
Kendall Notation 1/2/3(/4/5/6)

 Six parameters in shorthand


 First three typically used, unless specified
1. Arrival Distribution
2. Service Distribution
3. Number of servers
4. Total Capacity (infinite if not specified)
5. Population Size (infinite)
6. Service Discipline (FCFS/FIFO)

26
Kendall Classification of Queuing Systems

 The Kendall classification of queuing systems (1953) exists in several


modifications.
 The most comprehensive classification uses 6 symbols: A/B/s/q/c/p

where:
 A is the arrival pattern (distribution of intervals between arrivals).
 B is the service pattern (distribution of service duration).
 s is the number of servers.
 q is
i the
th queuing
i discipline
di i li (FIFO,
(FIFO LIFO,
LIFO ...).
) Omitted
O itt d for
f FIFO or if nott
specified.
 c is the system capacity. Omitted for unlimited queues.
 p is the population size (number of possible customers). Omitted for open
systems.
systems

27
Kendall Classification of Queuing Systems

These symbols are used for arrival and service patterns:


 M is the Poisson (Markovian) process with exponential
distribution of intervals or service duration respectively.
 Em is the Erlang distribution of intervals or service
duration.
 D is the symbol for deterministic (known) arrivals and
constant service duration.
 G is a general (any) distribution.

 GI is a g
general (any)
( y) distribution with independent
p random
values.

28
Kendall Classification of Queuing Systems

Examples:
 D/M/1 = Deterministic (known) input, one
exponential server, one unlimited FIFO or
unspecified
p q
queue,, unlimited customer p
population.
p
 M/G/3/20 = Poisson input, three servers with any
distribution, maximum number of customers 20,
unlimited customer population.
 D/M/1/LIFO/10/50 = Deterministic arrivals, one
exponential server, queue is a stack of the
maximum size 9 9, total number of customers 50
50.

29
Simulation of Queuing Systems
Measures of system performance
 The performance of a queuing system can be evaluated
in terms of a number of response parameters, however
the following four are generally employed.
1. Average number of customers in the queue or in the
system
2. Average waiting time of the customers in the queue or
in the system
3
3. System utilization
4. The cost of the waiting time & idle time

30
Simulation of Queuing Systems
Measures of system performance

 The knowledge of average number of customers in


the queue or in the system helps to determine the
space requirements
i t off the
th waiting
iti entities.
titi Also
Al ttoo
long a waiting line may discourage the prospectus
customers, while no queue may suggest that service
offered is not of good quality to attract customers.
 The knowledge of average waiting time in the queue
is necessary for determining the cost of waiting in
the queue.

31
Simulation of Queuing Systems

System
y Utilization
 System Utilization that is the percentage capacity utilized
reflects that extent to which the facility is busy rather
than idle.
 System utilization factor (s) is the ratio of average arrival
rate (λ) to the average service rate (µ).
S= λ/µ
µ in the case of a single
g server model
S= λ/µn in the case of a “n” server model
 The system utilization can be increased by increasing
the arrival rate which amounts to increasing the average
queue length as well as the average waiting time, as
shown in fig 1. Under the normal circumstances 100%
system utilization is not a realistic goal.

32
System Utilization

Fig 1 33
Time Oriented Simulation

A factoryy has large


g number of semiautomatic machines.On 50%
of the working days none of the machines fail. On 30%of the
days one machines fails and on 20%of the days two machines
fail. The maintenance staff on the average puts 65% of the
machines in order in one day, 30% in two days and remaining
5% in three days.
Simulate the system
y for 30 days
y duration and estimate the
average length of queue, average waiting time and server
loading that is the fraction of time for which server is busy.

34
Time Oriented Simulation
Solution:
Th given
The i system
t iis a single
i l server queuingi model.d l Th
The ffailure
il off th
the
machines in the factory generates arrivals, while the maintenance
staff is the service facility. There is no limit on the capacity of the
system in other words on the length of waiting line. The population
of machines is very large and can be taken as infinite.
Arrival pattern:
On 50%of the days arrival=0
O 30%of
On % f the days arrival=1
On 20%of the days arrival=2
Expected arrival rate=0*.5+1*.3+2*.2=0.7 per day.
S i pattern:
Service tt
65% machines in 1 day
30% machines in 2 days
5% machines in 3 da dayss

35
Time Oriented Simulation
Average service time: 1*.65+2*.3+3*.05=1.4 days
E
Expected
t d service
i rate=1/1.4=0.714
t 1/1 4 0 714 machines
hi per d day
The expected arrival rate is slightly less than the expected service rate
and hence the system can reach a steady state. For the purpose
of g
generating g the arrivals p
per day
y and the services completed
p p
per
day the given discrete distributions will be used.
Random numbers between 0 and 1 will be used to generate the
arrivals as under.
0.0<r<=0.5 Arrivals=0
0.5<r<=0.8 Arrivals=1
0.8<r<=1.0Arrivals=2
Si il l random
Similarly, d numbers
b b
between
t 0 and
d 1 will
ill b
be used
d ffor
generating the service times ( ST)
0.0<r<=0.65ST=1day
0 65<r<=0 95ST=2days
0.65<r<=0.95ST=2days
0.95<r<=1.0 ST=3 days
36
Time Oriented Simulation
 In the time-oriented simulation, the timer is advanced in fixed steps
of time and at each step the system is scanned and updated.
 The time is kept very small, so that not many events occur during
this time.
time
 All the events occurring during this small time interval are assumed
to occur at the end of the interval.
 At start of the simulation, the system
y that is the maintenance facility
y
can assumed to be empty, with no machine waiting for repair.
 On day 1, there is no machine in the repair facility.
 On day 2 there are 2 arrivals, the queue is made 2.
 Since service facility is idle, one arrival is put on service and queue
becomes 1.
 Server idle time becomes 1 day and the waiting time of customers
is also 1 day.
day Timer is advanced by one day day.
 The service time, ST is decreased by one and when ST becomes
zero facility becomes idle.
 Arrivals are ggenerated which come out to be 1,, it is added to the
queue.

37
Time Oriented Simulation
 Facility is checked, which is idle at this time.
 One customer is drawn from the queue, its service time is
generated.
 Idle time and waiting time are updated. The process is continued till
th end
the d off simulation.
i l ti
 The following statistics can be determined.
Machine failures( arrivals) during 30 days=21
Arrivals per day=21/30=0.7
Waiting time of customer=40 days
Waiting time per customer=40/21=1.9 days
Average length of the queue=1.9
Server idle time=4 days=4/30* 100=13.33 %
g ( 30-4)/30=0.87
Server loading=( )

38
39
Simulation on queuing system
Tutorial
In a manufacturing g system
y parts are being
p g made at a
rate of one every 6 minutes. They are two types A and
B and are mixed randomly with about 10 percent of
type B.
B A separate inspector is assigned to examine
each type of parts. The inspection of a part takes a
mean time of 4 minutes with a standard deviation of 2
minutes
i , but
b part B takes
k a mean timei 20 minutes
i andd
a standard deviation of 10 minutes. Both inspectors
reject
j about 10% of the p parts they
y inspect.
p Simulate
the system for total of 50 type A parts accepted and
determine , idle time of inspectors and average time a
part spends in system.
system

40

You might also like