You are on page 1of 37

Modeling & Simulation Lecture 6

Queuing Models Part2


:Instructor Eng. Ghada Al-Mashaqbeh The Hashemite University Computer Engineering Department

Outline
Introduction. Study of different queues types:
M/M/1 queue. M/M/s queue. M/M/1/c queue.

The Hashemite University

Introduction
In this lecture we will calculate the different performance measures for some queues types. Note that all these parameters are calculated under the steady state conditions.

The Hashemite University

A Study of M/M/1 Queues I


Customers arrive according to a Poisson process with rate .

j = ,

j0

There is only one server. Service time is exponential with rate .

0 = 0, j = ,

j 1

...

j-1

j+1
4

The Hashemite University

A Study of M/M/1 Queues II


We let = / which is called the traffic intensity or server utilization, so

0 1 j 1 j cj = = 12 j
From Balance equations:

1 = 0 , 2 = 0 , ,
2

j = 0
j
The Hashemite University 5

A Study of M/M/1 Queues III


As the stationary probabilities must sum to 1, therefore:

1 =0 +1 +2 + + j + 1 =0 (1 + + + + +)
2 j

But for <1,


2

1+ + + + + = 1/1
j

Therefore:

0 = (1 ) j = (1 ),
j The Hashemite University

j 1

Why to assume <1?


Since we want to study the queueing system under stable conditions, i.e. stable system. Stability requires that the arrival rate must be less than the service rate , i.e. the system can afford the required jobs. Stability means that steady state solution exist.

The Hashemite University

L of M/M/1 Queues
L is the expected number of entities in the system.

L = j =0 j P ( j entities in system)

= j =0 j j = j =0 j j (1 )

= (1 ) j =1 j

j 1

d = (1 ) j j =1 d
8

d = (1 ) ( )= = d 1The Hashemite 1 University

Lq of M/M/1 Queues
Lq is the expected number of entities in the queue.

Lq = j =1 ( j 1) P ( j entities in system)

= j =1 ( j 1) j = j =1 j j j =1 j

= L (1 0 ) = L

Lq = = 1 ( ) University The Hashemite


2 2

Littles Formula I
W is the expected waiting time in the system this includes the time in the line and the time in service. Wq is the expected waiting time in the queue. W and Wq can be found using the Littles formula. (explain it!!)

L = W Lq = Wq

L 1 W= =
10

The Hashemite University

Littles Formula II
Lets understand this formula using a simple example rather than proving it mathematically:
Assume that every customer pays 1 dollar per unit time it stays in the system. Also, assume that the customer will pay the total amount of dollars when leaving the system. You want to calculate the total amount of dollars paid by all customers per unit time (which is equal to the number of customers currently in the system). Remember each customer will stay in the system for W time units. At equilibrium: flow in = flow out, also W reaches somehow a constant value (mean value). So, W = L (dollars = number of customers). The same is applied for Wq.
The Hashemite University 11

M/M/1 queuing model Summary


= 0 = P( N = 0) = (1 ) n = P ( N = n)
= (1 )
n

1 W=

L = W = 1 Wq = W = ( ) 2 Lq = Wq = ( )

The Hashemite University

12

A Study of M/M/s Queues I

There are s servers. Customers arrive according to a Poisson process with rate , = , j 0 j Service time for each entity is exponential with rate . Let = /s

0 = 0 j = j, j s = s, j > s

The j Hashemite University

13

A Study of M/M/s Queues II

j-1

1
2

.. .. s s-1 s+1 . . ( s 1) s s

j
s

j+1

Thus

( s ) j = 0, j!
j j

js

( s ) j = 0 , j = s, s + 1, s + 2,... j s s! s
The Hashemite University

14

A Study of M/M/s Queues III

0 =

1 ( s ) ( s ) j=0 j! + s!(1 )
s 1 j s

The Hashemite University

15

A Study of M/M/s Queues IV


All servers are busy with probability

( s ) s P( j s) = j = 0 s!(1 ) j=s

This probability is used to find L,Lq, W, Wq The following table gives values of this probabilities for various values of and s

The Hashemite University

16

The Hashemite University

17

M/M/s Queues Parameters


P ( j s ) Lq = 1
P( j s) Wq = = s Lq

L = Lq +
P( j s) 1 W = = + = + s L Lq 1
The Hashemite University 18

M/M/s queuing system Needed for steady state


Steady state occurs only if the arrival rate is less than the maximum service rate of the system
Equivalent to traffic intensity = /s < 1

Maximum service rate of the system is number of servers times service rate per server
The Hashemite University 19

A Study of M/M/1/c Queues I


Customers arrive according to a Poisson process with rate . The system has a finite capacity of c customers including the one in service. There is only one server. Service times are exponential with rate .
The Hashemite University 20

A Study of M/M/1/c Queues II


The arrival rate is

j = , j = 0,

j c 1 jc

0 = 0 j = , j 1

1 0 = c+ 1 1

j = 0 , j =0,
j

j c j >c
The Hashemite University 21

A Study of M/M/1/c Queues III


L is the expected number of entities in the system.

(1 ( c +1) + c L= c+ 1 (1 )( 1 )
c

c+ 1

Lq = L (1 0 )

(1 (c +1) + c = c +1 (1 )(1 )
c
The Hashemite University

c +1

(1 ) c +1 1
22

A Study of M/M/1/c Queues IV


We shall use Littles formula to find W and Wq. Note that:
Recall that was the arrival rate. But if there are c entities in the system, any arrivals find the system full, cannot arrive. So, of the arrivals per time unit, some proportion are turned away. c is the probability of the system being full. So (1- c) is the actual rate of arrivals.
The Hashemite University

23

A Study of M/M/1/c Queues V

L W= (1 c ) Wq = Lq

(1 c )
24

The Hashemite University

Notes
In Kendalls notations also you must specify the queue discipline (FCFS, LCFS, etc.). If no discipline is specified as we have explored in this lecture then the discipline is FCFS by default. M in Kendalls notation refers exactly to Markovian which is the memoryless property of the exponential distribution. Studying the queue behavior of non-markovian queues is very hard and sometimes there is no closed from solution for the different queue parameters.

The Hashemite University

25

What about Queuing Networks??? Do you have any idea!??

The Hashemite University

26

Queuing Networks I
A queueing network is a collection of many queues with some paths between them. In other words it is a multi-stage queue discipline. Example:
C hildren and A dults C hildren

1
A dults

3
27

The Hashemite University

Queuing Networks II
For a queueing network you may interested in:
The whole network (or system): here you need to find closed form equations to describe the behaviour of the network. or may be you are interested in one queue from it: here you can apply the previous equations we have studied, all what you is to define the correct value of both the arrival and service rates.

The Hashemite University

28

Example I
Customers arrive at a fast food restaurant at a rate of 100 per hour and take 30 seconds to be served. How much time do they spend in the restaurant?
- Service rate = = 60/0.5=120 customers per hour - W = 1/ = 1/(120-100) = 1/20 hrs = 3 minutes

How much time they will wait in line?


Wq = W - 1/ = 2.5 minutes

How many customers in the restaurant?


L = W = 5

What is the server utilization?


= / = 5/6
The Hashemite University 29

Example II

The Hashemite University

30

Example III
You have the following queueing network of four M/M/1 queues labeled as 1, 2, 3, and 4. jobs arrive from outside at a rate of (job/hour) for both queues 1 and 2, jobs leaves queue 1 enters queue 3 as you see while jobs leaves from queue 2 and enter queue 3 with probability of 0.35 and enter queue 4 with probability of 0.65. Find all the performance parameters of queue 3 (i.e. given that average service time of this queue = 15 second.
The Hashemite University 31

Example III contd.


1 0.3 5
Solution:
On board.
The Hashemite University 32

0.6 5

Example IV

The Hashemite University

33

Example IV -- Solution

The Hashemite University

34

Example IV Solution cont

The Hashemite University

35

Example IV Solution cont

The Hashemite University

36

Additional Notes
It is your task to find the source for this material. This is the last lecture included in the first exam material.

The Hashemite University

37

You might also like