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

1

241-460 I nt r oduct i on t o Queuei ng


Net wor ks : Engi neer i ng Appr oach
Chapt er 10 M/ M/ S and M/ G/ 1 Queue
Assoc. Prof. Thossaporn Kamolphiwong
Centre for Network Research (CNR)
Department of Computer Engineering, Faculty of Engineering
Prince of Songkla University, Thailand
Chapt er 10 M/ M/ S and M/ G/ 1 Queue
Email : kthossaporn@coe.psu.ac.th
Out l i ne
M/ M/ s
Analysis M/ M/ s Analysis M/ M/ s
Average Number of cust omer ( N) in Syst em
Average Number of Cust omer in Queue (N
q
)
Wait ing Time (T)
Wait ing Time (T
q
) in queue
q
Example
Chapter 10 : M/M/s and M/G/1 Queue
2
M/ M/ s Queue
M/ M/ s
Cust omers arrive according t o a Poisson process Cust omers arrive according t o a Poisson process
wit h rat e
Service t ime for each ent it y is exponent ial wit h
rat e .
There are s servers.
Chapter 10 : M/M/s and M/G/1 Queue
M/ M/ s Queue
Poisson Arrival =
There are s servers.
Cust omers arrive according t o a Poisson process wit h
rat e
Queue
Server
Service rate =
Service t ime for each ent it y is exponent ial wit h rat e .
Chapter 10 : M/M/s and M/G/1 Queue

>
s
=
s n
s n
s
n
n

3
Exampl e
Queue
(Infinite buffer)
Server = 3
Chapter 10 : M/M/s and M/G/1 Queue
St at e t r ansi t i on Di agr am : M/ M/ s



s-1 2 s
1 0
s+ 1
n

2 3
(s-1)
s
s s
Chapter 10 : M/M/s and M/G/1 Queue
4
State Diagram for M/M/s
s 1 2 s
1 0
s+ 1



n

P
0
= P
1
P
1
= 2P
2
P
s-1
= sP
s
P
s
= sP
s+1
s-1 2 s
1 0
s+ 1
s
2
s

(s-1)
3
n

P
2
= 3P
3

P
s-1
= sP
s
Chapter 10 : M/M/s and M/G/1 Queue

P
n-1
= sP
n
( Cont i nue)
s 1 2 s 1 0

For n < s
P
0
= P
1
P
1
= 2P
2
s-1 2 s
1 0
s
2

(s-1) 3

n
P
0
= 12 3(n-1)n
n
P
n
n

(n-1)
n
P
1
2P
2
P
2
= 3P
3

P
n-1
= nP
n
Chapter 10 : M/M/s and M/G/1 Queue
s ,
3 2 1
0
s

= n P
n
P
n
n
n

5
( Cont i nue)
s-1 2 s
1 0
s+ 1

For n > s
P
0
= P
1
P
1
= 2P
2

n
P
0
= 12 3 ss
n-s

n
P
n
n

s 1 2 s
1 0
s+ 1
s
2 s
(s-1)
3
n
s
P
s-1
= sP
s
P
s+1
= sP
s+1

P
n-1
= sP
n
Chapter 10 : M/M/s and M/G/1 Queue
s n P
s s
P
n s n
n
>

=

,
3 2 1
0

M/ M/ s
For n < s
For n > s
s ,
3 2 1
0
s

= n P
n
P
n
n
n

s ,
3 2 1
0
>

=

n P
s s
P
n s n
n
n

s ,
!
1
0
s
|
.
|

\
|
|
|
.
|

\
|
= n P
n
P
n
n

s ,
!
1
0
>
|
.
|

\
|
|
|
.
|

\
|
=

n P
s s
P
s n
n
n

Chapter 10 : M/M/s and M/G/1 Queue


6
M/ M/ s

s |
.
|

\
|
|
|
.
|

\
|
s n P
n
n
0
!
1

>
|
.
|

\
|
|
|
.
|

\
|
. \
. \
=

s n
P
s s
n
P
s n
n
n
0
!
1
!

( )

s s n
P
s
n
0

Chapter 10 : M/M/s and M/G/1 Queue

s
=
( )

>
=
s n
P
s
s
P
n
P
n
s
n
0
0
!
!

M/ M/ s
P
0
+ P
1
+ P
2
+ P
3
+ = 1
1
0
=

= n
n
P
( ) ( )
1
! !
0
1
0
0
= +


=

= s n
n s s
n
n
P
s
s
P
n
s
( ) ( )
( )

+
=

=
1 ! !
1
1
0
0
s
s
n
s
P
s
s
n
n
( )
1
! !
0
1
0
0
= +


=

= s n
n
s s
n
n
s
s
P
n
s
P

( )
1
| |
Chapter 10 : M/M/s and M/G/1 Queue
( )
1
1 ! !
0
1
0
0
=
|
|
.
|

\
|

=


s s s
n
n
s
s
P
n
s
P
7
Pr obabi l i t y of Al l ser ver s ar e busy
I f t he number of cust omers in t he syst em is less
t han or equal t o s t hen all cust omers will be at a t han or equal t o s t hen all cust omers will be at a
server.
The probabilit y of arriving and finding all servers
busy (and t herefore having t o queue for a
server) :
n s
P
q
Chapter 10 : M/M/s and M/G/1 Queue

=
= = =
s n s n
n s
n q
P
s
s
P P P
0
!
) Full Server All (

( Cont i nue)

=
=
s n
n s
q
P
s
s
P
0
!

Because
=s n
( )

= =

1
1
0 i
i s n
( )

=
s n
s n
s
q
P
s
s
P

0
!
Prob. of all
Chapter 10 : M/M/s and M/G/1 Queue
( )
= =
1
0 i s n
( )
( )
0
1 !
P
s
s
P
s
q

=
servers are
busy
8
Aver age # of packet i n M/ M/ s
queue

( )


=
+

=
= =
0 i
s i
s n
n q
iP P s n N

=
+
=
0
0
!
i
s i s
q
iP
s
s
N

,i = n-s
Chapter 10 : M/M/s and M/G/1 Queue
( )

=
=
0
0
!
i
i
s
i P
s
s

M/ M/ s
( )

=
i
s
i P
s
N

( )
1
=

d
i
i i

=
=
0
0
!
i
q
i P
s
N
( )
0
0 0
1
1

|
|
.
|

\
|

=
|
.
|

\
|
=

=
= =
d
d
d
d
d
i
i
i
i i
( )

=
0
1
0
!
i
i
s
i P
s
s


( )
( ) ( )
( )
( )
0 0 2
1 ! 1 1 !
P
s
s
P
s
s
s s

=
Chapter 10 : M/M/s and M/G/1 Queue
( )
2
1
1

=
q q
P N

=
1
( ) ( ) ( )
9
M/ M/ s

=
1
q q
P N
Wh ll h k h
1

=
1
q
q
P
N
N(t) (M/M/1)
When all the servers are working, the system is
equivalent to an M/M/1 queue with a service
rate of s
Chapter 10 : M/M/s and M/G/1 Queue
Wai t i ng Ti me
Wait ing Time in Queue
Tot al Wait ing Time in Syst em
( )


=

= =
s
P P N
W
q q q
q
1
Chapter 10 : M/M/s and M/G/1 Queue

1 1
+

= + =
s
P
W T
q
q
10
Aver age # of Cust omer i n syst em
T N =
N
q

=
s
P
q

s P + =
Chapter 10 : M/M/s and M/G/1 Queue

s P
q
+

=
1
M/ M/ 2
n 1 2 n

1 0


P
0
= P
1
P
1
= 2P
2
n-1 2 n
2
1 0
2 2

2
P
2
= 2P
3
...................
P
n-1
= 2P
n
Chapter 10 : M/M/s and M/G/1 Queue
11
M/ M/ 2
n n n
P P
2
2 2 1

=
P
0
= P
1
P
1
= 2P
2
n
P P
0
2 2 1 =
0 ,
2
2
0
=
|
|
.
|

\
|
= n P P
n
n

0 2 P P
n
P
1
2P
2
P
2
= 2P
3
...................
P
n-1
= 2P
n
Chapter 10 : M/M/s and M/G/1 Queue


2
, 0 , 2
0
= = = n P P
n
n
M/ M/ 2
1 2
0 0
= +

n
P P
1
0 0
= n

1 2
1
0 0
= +

= n
n
P P
1 2
1
1
0 0
= +

n
n
P P
1 , = n m
Chapter 10 : M/M/s and M/G/1 Queue
1 = n
1 2
0
0 0
= +

= m
m
P P
12
M/ M/ 2
1 2
0 0
= +

m
P P
1 ,
1
1
0
<
+

P
1
1
2
1
0
=
|
|
.
|

\
|

P
0 = m
1
1
1
2
0 0
=

P P
Chapter 10 : M/M/s and M/G/1 Queue

1
. \

1
1
2 1
0
=
|
|
.
|

\
|


P
Aver age # of cust omer s i n Syst em

=
0
n
nP N
=0 n

=
=
0
0
2
n
n
P n N

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

Chapter 10 : M/M/s and M/G/1 Queue

=
=
0
1
0
0
2
n
n
n
n P
( ) 1
13
Aver age # of cust omer s i n Syst em
1
2 = P N
( )
2 0
1
2

= P N
( )
2
2
1
1
1
1
2

= N
Chapter 10 : M/M/s and M/G/1 Queue
2
1
2

=
Aver age # of cust omer s i n Syst em
10
i
n

M/M/1
2
3
4
5
6
7
8
9
n
u
m
b
e
r

o
f

c
u
s
t
o
m
e
r
s

i
s
y
s
t
e
m
M/M/1

=
1
N
M/M/2
Chapter 10 : M/M/s and M/G/1 Queue
0
1
2
0 0.2 0.4 0.6 0.8 1
/
A
v
e
r
a
g
e

n
2
1
2

= N
M/M/2
14
Exampl e
A print er is at t ached t o t he LAN of t he depart ment .
The print ing j obs are assumed t o arrive wit h a The print ing j obs are assumed t o arrive wit h a
Poissonian int ensit y and t he act ual print ing
t imes are assumed t o obey t he dist ribut ion
Exp(). The capacit y of t he print er has become
insufficient wit h regard t o t he increased load. I n
order t o improve t he print ing service, t here are
t hree alt ernat ives:
Chapter 10 : M/M/s and M/G/1 Queue
Ol d syst em

Chapter 10 : M/M/s and M/G/1 Queue


15
Case I : Sol ut i on
Replace t he old print er by a new one t wice as
fast , i.e. wit h service rat e 2. fast , i.e. wit h service rat e 2.
2


Chapter 10 : M/M/s and M/G/1 Queue
Case I I : Sol ut i on
Add anot her similar print er (service rat e ) and
divide t he users in t wo groups of equal size divide t he users in t wo groups of equal size
direct ing t he works in each group t o t heir own
print er. The arrival rat e of j obs t o each print er is
/ 2
Chapter 10 : M/M/s and M/G/1 Queue
16
( Cont i nue)

/2
/2
Chapter 10 : M/M/s and M/G/1 Queue
Case I I I : Sol ut i on
The same as alt ernat ive 2, but now t here is a
common print er queue where all j obs are t aken common print er queue where all j obs are t aken
and t he j ob at t he head of t he queue is sent t o
which ever print er becomes free first .


Chapter 10 : M/M/s and M/G/1 Queue
= /2

17
( Cont i nue)

Chapter 10 : M/M/s and M/G/1 Queue


Sol ut i on
Compare t he performance of t he alt ernat ives at
different loads. As measure of performance we different loads. As measure of performance we
use t he average t ot al wait ing t ime of j ob (
t ime in syst em, from t he arrival of t he print ing
j ob t o t he full complet ion of t he j ob)
Case I : I n t his case we have an M/ M/ 1 queue
wit h paramet er and 2 p
Chapter 10 : M/M/s and M/G/1 Queue

2
=
2
1
1
1
2
1
1
-

= T
18
Sol ut i on
Case I I : Now we have t wo separat e M/ M/ 1
queues wit h paramet ers / 2 and queues wit h paramet ers / 2 and
The load per server is t he same as before. Now
j t t hi h t t i l (b t h

2
2
= =

1
1
1
2
1
2
-

= T
j ust everyt hing happens t wo t imes slower (bot h
arrivals and t he service)
Chapter 10 : M/M/s and M/G/1 Queue
2
1
1
1
1
-

= T
Sol ut i on
Case I I I : I n t he case of a common print ing queue,
an appropriat e model is t he M/ M/ 2 queue wit h an appropriat e model is t he M/ M/ 2 queue wit h
paramet ers and

2
=
2
1 1
3

+ =
q
P T
Chapter 10 : M/M/s and M/G/1 Queue
2
1
1
1 1
-

+ =
q
P
19
Sol ut i on
M/ M/ 2
2
1
1
1 1
3
- + =
q
P T
( )
2
2 1
3

q
( )
( )
0
2
1 ! 2
2
P P
q

=
1
1
0
P

<<
~
1 1
1 ,
1
3

T
Chapter 10 : M/M/s and M/G/1 Queue

+
=
1
2
2
q
P

~ -

1 ,
2
1
1
1
3


Summar y of Compar i son
T
1
T
2
T
3
T
2
/T
1
T
3
/T
1
< < 1
2 2

1
1
1
-

2
1

1
2
1
1
1 1
-

+
q
P
2
1
1
1
-

1
~ 1
2 1
Chapter 10 : M/M/s and M/G/1 Queue
2
1
1
1
-

2

1
1
1
-

2
1
1
1
-

20
Summar y of Compar i son
Case I , one fast print er is t he best one
Case I I , t he t ot al wait ing t ime is t wice as long as
in case I
Case I I I , t he second print er does not help at all
t l l d h j b i t k di t l i t t h at low loads: each j ob is t aken direct ly int o t he
service (wit hout wait ing) but t he act ual print ing
t akes t wice t he t ime as wit h t he fast print er
Chapter 10 : M/M/s and M/G/1 Queue
M/ G/ 1
Poisson
M/G/1
Server
General
independent
Poisson arrivals at rat e
Service t ime are independent , ident ically
dist ribut ed wit h general PDF
o sso

independent
Service times
FCFS service
g
Single Server queue
Chapter 10 : M/M/s and M/G/1 Queue
21
M/ G/ 1
Cust omers arrive according t o a Poisson process
wit h rat e , but t he cust omer service t imes have
a general dist ribut ion. Cust omers are served in
t he order t hey arrive.
X
i
is t he service t ime of t he i
th
cust omer. (X
1
,X
2
, .
. .) are ident ically dist ribut ed, mut ually
independent and independent of t he int erarrival independent , and independent of t he int erarrival
t imes.
Chapter 10 : M/M/s and M/G/1 Queue
( Cont i nue)
W
i
: wait ing t ime in queue of t he i
th
cust omer.
R
i
: residual service t ime seen by t he i
th

cust omer. That is, if cust omer j is already being
served when i arrives, R
i
is t he remaining t ime
unt il cust omer js service t ime is complet e.
N
i
: t he number of cust omers found wait ing in
queue by t he i
th
cust omer upon arrival.
Chapter 10 : M/M/s and M/G/1 Queue
22
M/ G/ 1

2
X
W

2 2
X
W N
( )
=
1 2
W
q
( )

+ =
1 2
2
X
X T
( )

= =
1 2
W N
q q
( )

+ = =
1 2
2 2
X
T N
Chapter 10 : M/M/s and M/G/1 Queue
2
2
1
X
R

=
M/ G/ 1 Exampl es
M/ M/ 1 queue:
2
2
2

= X
and
M/ D/ 1 queue:
( )

=
1
q
W
2
2
1

= X
and
Chapter 10 : M/M/s and M/G/1 Queue
( )

=
1 2
q
W
23
M/ D/ 1 Queues
M : Poisson arrival process wit h rat e
D : Service t ime is const ant D : Service t ime is const ant
1 : single server, load = /
Convenient way t o model an Asynchronous
Transfer Mode (ATM) node wit h fixed size cells
Good model for packet swit ching node or rout er p g
in a comput er net work where t he packet s are of
fixed sized
Chapter 10 : M/M/s and M/G/1 Queue
M/ D/ 1
Average number of cust omer in syst em
1
2
Average wait ing t ime in syst em

+ =
1 2
1
2
N
1 1
|
|

|
Chapter 10 : M/M/s and M/G/1 Queue

1
1 2
1
1
|
|
.
|

\
|

+ = T
24
M/ D/ 1 Exampl e
The out put buffer of an ATM mult iplexer can be
modeled as an M/ D/ 1 queue. Const ant service modeled as an M/ D/ 1 queue. Const ant service
t ime means now t hat an ATM cell has a fixed
size (53 oct et s) and it s t ransmission t ime t o t he
link is const ant . I f t he link speed is 155 Mbit / s.
What is t he mean number of cells in t he buffer
(including t he cell being t ransmit t ed) and t he ( g g )
mean wait ing t ime of t he cell in t he buffer when
t he average informat ion rat e on t he link is 124
Mbit / s?
Chapter 10 : M/M/s and M/G/1 Queue
( Cont i nue)
155 Mbits/s
ATM M
124 Mbits/s.
Chapter 10 : M/M/s and M/G/1 Queue
ATM Mux.
25
Sol ut i on
Link speed = 155 Mbit / s
= 155 Mbit s/ s = 155 Mbit s/ s
1 oct et = 8 bit s
t ransmission t ime = 53 8/ 155M = 2.7 s
= 124 Mbit s/ s
The load (ut ilizat ion) of t he link is
= 124/ 155
= 0.8
Chapter 10 : M/M/s and M/G/1 Queue
Aver age number of ATM cel l s
M/ D/ 1
4 . 2
8 . 0 1
8 . 0
2
1
8 . 0
2
=

+ = N

+ =
1 2
1
2
N
Chapter 10 : M/M/s and M/G/1 Queue
8 . 0 1 2
26
mean wait ing t ime of t he cell in t he buffer
( Cont i nue)
8 0 1
| |

1
1 2
1
1
|
|
.
|

\
|

+ = T
Chapter 10 : M/M/s and M/G/1 Queue
s 1 . 8 s 7 . 2
8 . 0 1
8 . 0
2
1
1 =
|
.
|

\
|

+ = T
Summar y of Compar i son
At heavy loads, t he t ot al wait ing t ime of case 3 is
t he same as in case 1 (in bot h cases it consist s
i l f h i i ) T l i f d b mainly of t he wait ing). Two slow print ers fed by a
common queue discharge t he work in t he queue as
efficient ly as one fast print er
Case 2, when t he queues are separat e, it is possible
t hat one print er st ays idle while t here are j obs
wait ing in t he queue for t he ot her print er. This
det eriorat es t he overall performance in such a way det eriorat es t he overall performance in such a way
t hat also at high loads alt ernat ive 2 is on t he
average t imes slower t han alt ernat ive 1
Chapter 10 : M/M/s and M/G/1 Queue
27
Ref er ences
1. Robert B. Cooper, I nt roduct ion t o Queueing
Theory, 2nd edit ion, Nort h Holland,1981. Theory, 2nd edit ion, Nort h Holland,1981.
2. Donald Gross, Carl M. Harris, Fundament als of
Queueing Theory, 3rd edit ion, Wiley-
I nt erscience Publicat ion, USA, 1998.
3. Leonard Kleinrock, Queueing Syst ems Volumn
I : Theory, A Wiley-I nt erscience Publicat ion, I : Theory, A Wiley I nt erscience Publicat ion,
Canada, 1975.
Chapter 10 : M/M/s and M/G/1 Queue
( Cont i nue)
4. Georges Fiche and Gerard Hebut erne,
Communicat ing Syst ems & Net works: Traffic & Communicat ing Syst ems & Net works: Traffic &
Performance, Kogan Page Limit ed, 2004.
5. Jerimeah F. Hayes, Thimma V. J. Ganesh Babu,
Modeling and Analysis of Telecommunicat ions
Net works, John Wiley & Sons, 2004.
Chapter 10 : M/M/s and M/G/1 Queue

You might also like