You are on page 1of 13

Queues: A queue is a system into which customers arrive to receive service.

When the
servers in the system are busy, incoming customers wait for their turn. Upon completion of
a service, the customer to be served next is selected according to some queuing discipline.

Queuing discipline: The queuing discipline is a rule for selecting the customer for the next
service among the set waiting customer. This could be either First in first out (FIFO), Last
in first out (LIFO), Service in random order (SIRO), Shortest processing time (SPT), etc.

A queuing system can be completely described by:

(a). The input or arrival pattern,

(b). The service mechanism or service pattern,

(c). The queue discipline,

(d). Customers behavior,

(e). The size of population, and

(f). Maximum length of a queue.

Notation for queues: Generally queuing model may be completely specified in the follow-
ing symbolic form: (A/B/C):(D/E), where
A: probability law for the arrival (or inter-arrival) time
B: probability law according to which the customers are being served
C: number of service channels (service stations)
D: capacity of the system, i.e., the maximum number allowed in the system (in service or
waiting)
E: queue discipline.
D. Kendall (1953) introduced the three characteristics (A/B/C), later, A. Lee (1966) added
fourth and fifth characteristics to the notations.

Let C1 , C2 , . . . be any arbitrary arrival stream of customers with


tj = arrival epoch of Cj , (0 t1 t2 . . . < ), and
Tj = tj+1 tj is inter-arrival time between Cj and Cj+1
A customer who has arrived but not yet departed is said to be in the system. While in the
system, a customer may be either in service or in the queue. Let,
Sj = service time of Cj

1
Dj = delay in queue of Cj , (waiting time in queue)
Wj = Dj + Sj = waiting time in system of Cj .

The number of customers in the system at epoch t is given by N (t), which can be written as

N (t) = Nq (t) + Ns (t)

where Nq (t) = number of customers in the queue at time t, and


Ns (t) = number of customers in the service at time t.

The number of arrivals by time t, nA (t) and number of departures by time t, nD (t), are given
by:

nA (t) = max{j : tj t}
nD (t) = nA (t) N (t)

The process {nA (t) : t 0} is called the arrival process and the process {nD (t) : t 0} is
called the departure process.

Performance Measures: The performance of a queue will be defined in terms of proper-


ties of one or more of the following stochastic processes: {N (t) : t 0}, {Nq (t) : t 0},
{Ns (t) : t 0}, {Wj : j N }, and {Dj : j N }.
Let us define the following parameters first:
nA (t)
= Arrival rate = limt t
1 1
P
n

= Average time in service = limn n


Sj , where is called the service rate. We now
j=1
define generic measures of performance for a queue. Let, m be the number of identical servers
in the queuing system.

Average number of customers in the system:


Zt
1
L = lim N (u)du (1)
t t
0

Average number of customers in the queue (mean queue length):

Zt
1
Q = lim Nq (u)du (2)
t t
0

2
Average number of customers in the service:
Zt
1
B = lim Ns (u)du (3)
t t
0

Average server utilization:


B
U= (4)
m
Average waiting time in the system:
n
1X
W = lim Wj (5)
n n
j=1

Average waiting time in the queue:


n
1X
D = lim Dj (6)
n n
j=1

In the above, the measures L, Q, B and U are averages over time, whereas the measures W
and D are averages over customers. The values on the right hand side are random variables.

Littles Result: The result states that, given a queue, if the limits:
Pn
= limt nAt(t) and W = limn n1 Wj exist, with < and W < , then the
j=1
following limit,
Zt
1
L = lim N (u)du
t t
0

exists, where L < and

L = W (7)
A consequence of Littles result is that if the limits defining and D exist, with < ,
D < , then the limit defining Q exists, with Q < and Q = D. Note that this enables
the result to be applied to parameters connected with the queue alone.

The M/M/1 Queue: In the M/M/1 queue, the arrivals are following Poisson distribution
with rate , the departures are following Poisson distribution with rate , and there is only
single server.

Let N (t) be the number of customers in the M/M/1 queue at time t, then obviously {N (t) :
t 0} is a CTMC. Also it is a special case of Birth and Death Process with:

3
k = k 0
k = k 1

The ratio =
is called as traffic intensity of the system.
From the last equation of BD process, we have:
1
0 = P k = (1 ) (8)

k0

That is, the probability of an empty system is given by (1 ). Thus represents the
proportion of the time, the server is busy. This is called the utilization U of the server or
traffic intensity of the queue.
k = k (1 ), k0 (9)
The probability k is to be described, in the following ways:
as the proportion of time in the steady state the system has exactly k customers,

in the steady state, a randomly arriving customer finds exactly k customers in the
system,

a departing customer leaves behind exactly k customers in the system.


The mean number of customers in the system, L is found as the expected value of random
variable N , where,

P {N = k} = lim P {N (t) = k} = k
t
Thus we have,

X
X
L = E[N ] = kk = (1 ) kk (10)
k=0 k=0
But, we have,

X
kk = (11)
k=0
(1 )2
So by (10) and (11), we have,


L= = (12)
1
The mean number of customers, Q in the queue is similarly given as
X X X
Q = (k 1)k = kk k
k=1 k=1 k=1
= L (1 0 ) = L
2 2
= = (13)
1 ( )

4
We can also rewrite as,
L=Q+
Now, W : the mean waiting time in the system or mean response time, is given by,
1
W =D+ (14)

1
where,
is the service time. To find out the explicit formula for W , we use Littles formula,

L = W (15)

Using (15), we obtain the expressions for W and D for the M/M/1 queue. From (12) and
(15), we have,
L 1 1
W = = = (16)
(1 )
and, from (14)
1 1
D= = (17)
( )
Example 1. Consider an NC machine center processing raw parts one at a time in M/M/1
fashion. Let = 8 parts/h and = 10 parts/h. Then find out:

a. Machine utilization,

b. Mean number of customers in the system,

c. Mean number of customers in the queue,

d. Mean waiting time in the system, and

e. Mean waiting time in queue.

The answers are 0.8, 4.0, 3.2, 0.5 h, and 0.4 h.

Stability of M/M/1 Queue: From (8), we see that:


1
0 = P
k
k0

We can solve this equation for 0 if and only if the series in the numerator is convergent.
The series will be convergent if and only if < 1. When 1, the series diverges, which
means that the queue grows without bound and the values of L, Q, W and D would go to
infinity. We say that the queue is stable if < 1 and it is unstable if 1. The stabil-
ity condition physically means that the arrival rate must be strictly less than the service rate.

5
When is close to 1, queues become very long and as 1, the number in the system
grows without bound. Transient analysis reveals system behavior as 1 or short term
behavior when > 1. Waiting Time Distributions: We have seen that W and D are the
mean values of the random variables w and d, whose distributions can be defined by:
n
1X
Fw (t) = lim P {Wj t}
n n
j=1
n
1X
Fd (t) = lim P {Dj t}
n n
j=1

Now we will calculate Fw (t) and Fd (t), assuming that the customers are served in FIFO (or
FCFS) order.

First note that d is a continuous random variable except that there is a nonzero probability,
0 that d = 0 and the customers enters service immediately on arrival. We have:

Fd (0) = P {d 0} = P {d = 0}
= P {System is empty on arrival}

So,
Fd (0) = 0 = 1 (18)
Now we will find Fd (t) for t > 0. If there are k customers in the system upon arrival, for the
customer to get into the system between 0 and t, all k units must be served by the time t.
Since the service time distribution is memoryless, the distribution of the time required for
k service times is independent of the time of the current arrival, and is the convolution of k
exponential random variables, which is an Erlang-k distribution.
The probability density function of the Erlang distribution is:
(x)k1 ex
f (x; k, ) = for x, 0
(k 1)!
The parameter k is called the shape parameter and the parameter is called the rate pa-
rameter.

The probability that an arrival finds k units in the system in the steady state is simply the
probability k . Thus we have:

Fd (t) = P (d t)
X
= Fd (0) + P (0 < d t|k units in the system)k
k=1

6
P (0 < d t|k units in the system) = P (sum of k service times t)
Zt
(x)k1 ex
= dx
(k 1)!
0

Therefore, we get for t > 0,


X Zt
k (x)k1 ex
Fd (t) = (1 ) + (1 ) dx
k=1
(k 1)!
0
Zt X

x (x)k1
= (1 ) + (1 ) e dx
k=1
(k 1)!
0
Zt
= (1 ) + (1 ) ex(1) dx (19)
0

Simplifying (19) we get:


Fd (t) = 1 e(1)t for t > 0

The distribution for waiting time in queue is then:



1 , for t = 0
Fd (t) = (20)
1 e(1)t for t > 0

From (20), we can compute the mean waiting time in queue as:


D = E[D] = (21)
( )

Let us now compute the distribution of w, following the similar arrangements. We have for
t 0,

X
Fw (t) = P (w t|k units in the system)k
k=0
X
= P (sum of (k + 1) service times t)k
k=0

X Z t
(x)k ex
= dx k (1 )
k=0
k!
0

7
Zt
X
x (x)k
= (1 ) e dx
k=0
k!
0
Zt
= (1 ) ex(1) dx
0
(1)t
= 1e
= 1 e()t

Thus we have:
0, for t < 0
Fw (t) = (22)
1 e()t , for t 0.

Therefore, w is exponentially distributed with mean given by:


1
W =

It is noted that the mean values D and W are independent of the queuing discipline, whereas
the distributions of d and w depend on the queuing discipline.
The M/M/1/N Queue: In an M/M/1/N queueing system, the maximum number of jobs
in the system is N , which implies a maximum queue length of N 1. An arriving job enters
the queue if it finds fewer than N jobs in the system and is lost otherwise. This behavior
can be modeled by a birth-death process with:

for k = 0, 1, 2, . . . , N 1
k =
0 for k N

The service rate k = for all k 1. The CTMC here is a finite birth and death process,
with N + 1 states. The steady state probabilities are given by:

(1 )k
k = , k = 0, 1, 2, . . . , N
1 N +1
= 0, k > N (23)

Note that a system with finite population such as above will always be stable for all values
of .

The performance measures can be verified to be given by:

(1 N )
U = 1 0 = (24)
1 N +1

8
2 [1 N N N 1 (1 )]
Q= (25)
(1 )(1 N +1 )

[1 N N N (1 )]
L= (26)
(1 )(1 N +1 )

1 N N N (1 )
W = (27)
(1 )(1 N )

[1 N N N 1 (1 )]
D= (28)
(1 )(1 N )
Example 2. It would be interesting to study the performance measures of a single-server
queuing system for various queue capacities. First, consider the M/M/1 queue of Example
1, where we had = 8 parts/h and = 10 parts/h. We have seen that U = 0.8, L = 4,
Q = 3.2, W = 0.5 h and D = 0.4 h.

At the other extreme, we have M/M/1/1 system in which no queuing is allowed. In this case,
there are only two states, 0 and 1, and

0 = +
= 0.556; and 1 = 0.444
Verify that U = 0.444, L = Q = 0.444, and W = D = 0.1h.
Can you calculate the performance measures for M/M/1/10 queue?

Example 3. Consider a machine center modeled as an M/M/1/N queue with parameters


and . Let C be the cost of operating the machine at a rate of and let a profit of q accrue
for every finished part produced. Find out the service rate that maximizes the total profit.

Solution: Production rate of the machine center=U


n
(1 ) N
( )N
= 1N +1 = N +1 N +1

The above is the number of parts produced in one time unit (for example one hour, if is
expressed in terms of parts per hour). The corresponding total profit is given by:

(N N )
P = q C
N +1 N +1
The service rate that maximizes the profit can now be obtained in the usual way.

The M/M/m Queue: Consider a queuing system with Poisson arrival rate as before,
but where m( 1) exponential servers, with rate each, share a common queue. This is
referred to as the M/M/m queue and is illustrated in Fig. 1. If the number of customers in
the system is greater than the number of servers, then a queue forms.

9
Figure 1: M/M/m queue and its state diagram

Steady State Analysis:


The M/M/m queue is also a special case of the birth and death model with rates:

k = , k = 0, 1, 2, . . . (29)

k = k, k = 0, 1, . . . , m
= m, k > m (30)

The state transition diagram is shown in Fig. 1. The steady state probabilities could be
obtained by using (29) and (30) in the expressions of 0 and k of BD process. We find that:

0 (m)k
k = ; k = 0, 1, 2, . . . , m
k!
0 mm k
= ; k>m (31)
m!
where is defined as:

= (32)
m
Equation (31) is valid for determining the steady state probabilities whenever < 1, i.e.,
the stability condition holds. The expression for 0 can now be obtained using (31) and the

10
fact that the steady state probabilities sum up to 1. Thus:
X (m)km1 1
(m)m
0 = + (33)
m!(1 ) k=0 k!

To compute the different performance measures, we first consider Ns , the number of busy
servers in the steady state. Ns is a discrete random variable with range {0, 1, 2, . . . , m} and
with pmf given by:

P (Ns = k) = k k = 0, 1, . . . , m 1
X
= j k=m
j=m

The average number of busy servers in the steady state, B can be immediately obtained as:
m
X
B = E[Ns ] = kP (Ns = k) = (34)
k=0

The mean utilization U of each server is simply the ration of B to the total number of servers
and hence:

U== (35)
m
We now compute Q, the average number of customers waiting in queue:

X (m)m 0
Q= (k m)k = (36)
k=m
m!(1 )2

The average number L in the system is given by:


(m)m 0
L=Q+B = 2
+ (37)
m!(1 )
We now use Littles law to compute the average waiting time in the system. We have:
L (m)m 0 1
W = = + (38)
m!(1 )2
The average waiting time in queue can now be obtained as:
1 (m)m 0
D=W = (39)
m!(1 )2

Departure Process of M/M/m Queue (For self study): Here we present the important
result that the departures of customers from an M/M/m queue occur according to a Poisson

11
process when the queue is in steady state. This important result is due to Burke (1956). If
N (t) is the number in the queuing system at time t, then recall the notation:

N (t) = nA (t) nD (t)

where nA (t) and nD (t) are the number of arrivals into the system and the number of de-
partures from the system by time t, respectively. Recall that the process {nA (t) : t 0}
is called the arrival process whereas {nD (t) : t 0} is called the departure process of the
queue. Consider M/M/m queue in steady state so that:

P (N (t) = k) = k ; k = 0, 1, 2, . . .

Let X represents the inter departure time, i.e., the time between successive departures from
the queue. Let us assume a condition on the event that a departure leaves the M/M/m
queue with k customers in the system (k = 0, 1, 2 . . .).

If k m, that is, if a departure leaves the system with at least m customers left behind,
then the time until next departure is EXP (m).

If 1 k m, then the time until next departure is EXP (k). Finally, if k = 0, the time
until the next departure will be the sum of the time until next arrival and the service time,
i.e. EXP () + EXP (). Since the system is in steady state, we can therefore write that:

X
X = EXP (m) with probability j
j=m
= EXP (k) with probability k , k = 1, 2, . . . , m 1
= EXP () + EXP () with probability 0

Now, using the total probability theorem, we have:


X m1
X
X= j EXP (m) + [k EXP (k)]
j=m k=1
+ 0 [EXP () + EXP ()]

From the above it can be shown that:

X = EXP ()

It is also true that the random variable N (t) and X are independent and furthermore that
successive inter-departure times are i.i.d. Thus the successive departures from an M/M/m

12
queue in steady state constitute a Poisson process with rate .

The above result play an important role in the analysis of queuing networks. A more fun-
damental proof of this result uses the time reversibility property of birth and death process.

The M/M/ Queue: In an M/M/ queueing system we have a Poisson arrival process
with arrival rate and an infinite number of servers with service rate each. If there are k
jobs in the system, then the overall service rate is k because each arriving job immediately
gets a server and does not have to wait. Once again, the underlying CTMC is a birth-
death process. From the expressions of 0 and k of BD process, we obtain the steady-state
probability of k jobs in the system:
k1
Y k
1
k = 0 = 0 (40)
i=0
(i + 1) k!

and the steady state probability of no jobs in the system:


1
= e( )

0 = k
P (41)
1
1+ k!
k=1

and finally:
k
e( )



k = (42)
k!
This is the Poisson pmf, and the expected number of jobs in the system is:

L= (43)

With Littles theorem, the mean waiting time in the system is given by:
1
W = (44)

13

You might also like