ReviewCh10-M-M-S

27
1 241-460 Introduction to Queueing Networks : Engineering Approach Chapter 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 Chapter 10 M/M/S and M/G/1 Queue Email : [email protected] Outline M/M/s Analysis M/M/s Analysis M/M/s Average Number of customer (N) in System Average Number of Customer in Queue (N q ) Waiting Time (T) Waiting Time (T q ) in queue Example Chapter 10 : M/M/s and M/G/1 Queue

Transcript of ReviewCh10-M-M-S

Page 1: ReviewCh10-M-M-S

1

241-460 Introduction to QueueingNetworks : Engineering Approach

Chapter 10 M/M/S and M/G/1 Queue

Assoc. Prof. Thossaporn KamolphiwongCentre for Network Research (CNR)

Department of Computer Engineering, Faculty of EngineeringPrince of Songkla University, Thailand

Chapter 10 M/M/S and M/G/1 Queue

Email : [email protected]

Outline

M/M/sAnalysis M/M/sAnalysis M/M/s

Average Number of customer (N) in System

Average Number of Customer in Queue (Nq)

Waiting Time (T)

Waiting Time (Tq) in queueq

Example

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

Page 2: ReviewCh10-M-M-S

2

M/M/s Queue

M/M/s Customers arrive according to a Poisson processCustomers arrive according to a Poisson process

with rate Service time for each entity is exponential with

rate .

There are s servers.

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

M/M/s Queue

Poisson Arrival =

There are s servers. Customers arrive according to a Poisson process with

rate

Queue

Server

Service rate =

Service time for each entity is exponential with rate .

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

sn

sn

s

nn

Page 3: ReviewCh10-M-M-S

3

Example

Queue

(Infinite buffer) Server = 3

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

State transition Diagram : M/M/s

s-12 s10 s+1… n… …

µ 2µ 3µ (s-1)µ sµ sµ sµ

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

Page 4: ReviewCh10-M-M-S

4

State Diagram for M/M/s

s 12 s10 s+1

n

P0 = P1

P1 = 2P2

Ps-1 = sPs

Ps = sPs+1

s-12 s10 s+1

sµ2µ sµµ

(s-1)µ3µ

n…

P2 = 3P3

Ps-1 = sPs

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

Pn-1 = sPn

(Continue)

s 12 s10

n

For n < s

P0 = P1

P1 = 2P2

s-12 s10sµ2µµ

(s-1)µ3µ

nP0 = 12 3… (n-1)n nPn

n …

(n-1)µnµ

P1 2P2

P2 = 3P3

Pn-1 = nPn

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

s ,321 0

nP

nP

n

n

n

Page 5: ReviewCh10-M-M-S

5

(Continue)

s-12 s10 s+1

n…

For n > s

P0 = P1

P1 = 2P2

…nP0 = 12 3… ssn-s nPn

n

s 12 s10 s+1

sµ2µ sµµ (s-1)µ3µ

nsµ

Ps-1 = sPs

Ps+1 = sPs+1

Pn-1 = sPn

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

snPss

Pnsnn

,

321 0

M/M/s

For n < s For n > s

s ,321 0

nP

nP

n

n

n s ,

321 0

nPss

Pnsn

n

n

s ,!

10

nP

nP

n

n

s ,!

10

nP

ssP

sn

n

n

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

Page 6: ReviewCh10-M-M-S

6

M/M/s

snP

n

n

0!

1

snP

ss

nP

sn

nn

0!

1

!

snP

s n

0

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

s

snPs

s

PnP

nsn

0

0

!

!

M/M/s

P0 + P1 + P2 + P3 + … = 1 10

nnP

1

!! 0

1

00

sn

nss

n

n

Ps

sP

n

s

1!!

11

0

0

ss

ns

P ss

n

n

1

!! 0

1

00

sn

nss

n

n

s

sP

n

sP

1

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

1

1!! 0

1

00

sss

n

n

s

sP

n

sP

Page 7: ReviewCh10-M-M-S

7

Probability of All servers are busy

If the number of customers in the system is less than or equal to s then all customers will be at athan or equal to s then all customers will be at a server.

The probability of arriving and finding all servers busy (and therefore having to queue for a server) :

ns

Pq

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

sn sn

ns

nq Ps

sPPP 0!

)FullServer All(

(Continue)

sn

ns

q Ps

sP 0!

Because

sn

1

1

0i

isn

sn

sns

q Ps

sP

0!

Prob. of all

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

10isn

01!

Ps

sP

s

q

servers are busy

Page 8: ReviewCh10-M-M-S

8

Average # of packet in M/M/s queue

0i

sisn

nq iPPsnN

0

0!i

sis

q iPs

sN

,i = n-s

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

0

0! i

is

iPs

s

M/M/s

is

iPs

N 1

di ii

0

0! iq iP

sN

0

00

1

1

d

d

d

d

di

i

i

ii

0

10! i

is

iPs

s

002 1!11!

Ps

sP

s

s ss

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

21

1

qq PN

1

Page 9: ReviewCh10-M-M-S

9

M/M/s

1qq PN

Wh ll h k h

1

1q

q

P

NN(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

Waiting Time

• Waiting Time in Queue

• Total Waiting Time in System

s

PPNW qqq

q 1

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

11

s

PWT q

q

Page 10: ReviewCh10-M-M-S

10

Average # of Customer in system

TN Nq

s

Pq

sP

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

sPq

1

M/M/2

n 12 n

10

P0 = P1

P1 = 2P2

n-12 n

10

µ 2µ2µ

P2 = 2P3

...................

Pn-1 = 2Pn

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

Page 11: ReviewCh10-M-M-S

11

M/M/2

nnn PP 2221 P0 = P1

P1 = 2P2nPP 0 221

0, 2

2 0

nPP

n

n

02 PP n

P1 2P2

P2 = 2P3

...................Pn-1 = 2Pn

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

2, 0, 2 0 nPP n

n

M/M/2

12 00

nPP 1

00 n

121

00

n

nPP

121

100

n

nPP 1, nm

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

1n

120

00

m

mPP

Page 12: ReviewCh10-M-M-S

12

M/M/2

12 00

mPP

1 , 1

10

P11

210

P

0m

11

12 00

PP

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

1

11

210

P

Average # of customers in System

0

nnPN0n

0

02n

nPnN

0

02 nnPN 21

1

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

0

10

0

2n

n

n

nP

1

Page 13: ReviewCh10-M-M-S

13

Average # of customers in System

12 PN

201

2

PN

22

1

1

1

12

N

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

21

2

Average # of customers in System

10in

M/M/1

23456789

num

ber

of c

ust

omer

s i

syst

em

M/M/1

1

N

M/M/2

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

012

0 0.2 0.4 0.6 0.8 1

/

Ave

rage

n

21

2

N

M/M/2

Page 14: ReviewCh10-M-M-S

14

Example

A printer is attached to the LAN of the department. The printing jobs are assumed to arrive with aThe printing jobs are assumed to arrive with a Poissonian intensity and the actual printing times are assumed to obey the distribution Exp(µ). The capacity of the printer has become insufficient with regard to the increased load. In order to improve the printing service, there are three alternatives:

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

Old system

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

Page 15: ReviewCh10-M-M-S

15

Case I : Solution

Replace the old printer by a new one twice as fast, i.e. with service rate 2µ.fast, i.e. with service rate 2µ.

2

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

Case II : Solution

Add another similar printer (service rate µ) and divide the users in two groups of equal sizedivide the users in two groups of equal size directing the works in each group to their own printer. The arrival rate of jobs to each printer is /2

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

Page 16: ReviewCh10-M-M-S

16

(Continue)

/2

/2

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

Case III : Solution

• The same as alternative 2, but now there is a common printer queue where all jobs are takencommon printer queue where all jobs are taken and the job at the head of the queue is sent to which ever printer becomes free first.

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

= /2

Page 17: ReviewCh10-M-M-S

17

(Continue)

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

Solution

Compare the performance of the alternatives at different loads. As measure of performance wedifferent loads. As measure of performance we use the average total waiting time of job (time in system, from the arrival of the printing job to the full completion of the job)

Case I : In this case we have an M/M/1 queue with parameter and 2p

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

2

2

1

1

1

2

11

T

Page 18: ReviewCh10-M-M-S

18

Solution

Case II : Now we have two separate M/M/1 queues with parameters /2 and queues with parameters /2 and

The load per server is the same as before. Now j t thi h t ti l (b th

2

2

1

1

1

2

12

T

just everything happens two times slower (both arrivals and the service)

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

2

1

1

11

T

Solution

Case III : In the case of a common printing queue, an appropriate model is the M/M/2 queue withan appropriate model is the M/M/2 queue with parameters and

2

2

113

qPT

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

2

1

1

11

qP

Page 19: ReviewCh10-M-M-S

19

Solution

M/M/22

1

1

113 qPT

2 213 q 0

2

1!2

2PPq

1

10P

11

1,1

3

T

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

1

2 2

qP

1,

2

1

1

13

Summary of Comparison

T1 T2 T3 T2/T1 T3/T1

<< 12 2

1

1

1

2

11

2

1

1

11

qP

2

1

1

1

1

12 1

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

2

1

1

1

2

1

1

1

2

1

1

1

Page 20: ReviewCh10-M-M-S

20

Summary of Comparison

• Case I , one fast printer is the best one

• Case II, the total waiting time is twice as long as in case I

• Case III, the second printer does not help at all t l l d h j b i t k di tl i t that low loads: each job is taken directly into the

service (without waiting) but the actual printing takes twice the time as with the fast printer

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

M/G/1

Poisson

M/G/1 Server General independent

• Poisson arrivals at rate • Service time are independent, identically

distributed with general PDF

o sso

independent Service times

µFCFS service

g• Single Server queue

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

Page 21: ReviewCh10-M-M-S

21

M/G/1

• Customers arrive according to a Poisson process with rate , but the customer service times havea general distribution. Customers are served in the order they arrive.

• Xi is the service time of the ith customer. (X1,X2, . . .) are identically distributed, mutually independent and independent of the interarrivalindependent, and independent of the interarrival times.

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

(Continue)

• Wi : waiting time in queue of the ith customer.

• Ri : residual service time seen by the ith customer. That is, if customer j is already being served when i arrives, Ri is the remaining time until customer j’s service time is complete.

• Ni : the number of customers found waiting in queue by the ith customer upon arrival.

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

Page 22: ReviewCh10-M-M-S

22

M/G/1

2XW

22 XWN

12Wq

12

2XXT

12

WN qq

12

22 XTN

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

22

1

XR

M/G/1 Examples

• M/M/1 queue: 22 2

X

and

• M/D/1 queue:

1qW

22 1

X

and

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

12qW

Page 23: ReviewCh10-M-M-S

23

M/D/1 Queues

M : Poisson arrival process with rate D : Service time is constantD : Service time is constant1 : single server, load = /

• Convenient way to model an Asynchronous Transfer Mode (ATM) node with fixed size cells

• Good model for packet switching node or router p gin a computer network where the packets are of fixed sized

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

M/D/1

• Average number of customer in system

1 2

• Average waiting time in system

12

1 2

N

11

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

1

12

11

T

Page 24: ReviewCh10-M-M-S

24

M/D/1 Example

The output buffer of an ATM multiplexer can be modeled as an M/D/1 queue. Constant servicemodeled as an M/D/1 queue. Constant service time means now that an ATM cell has a fixed size (53 octets) and its transmission time to the link is constant. If the link speed is 155 Mbit/s.

What is the mean number of cells in the buffer (including the cell being transmitted) and the ( g g )mean waiting time of the cell in the buffer when the average information rate on the link is 124 Mbit/s?

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

(Continue)

155 Mbits/sATM M

124 Mbits/s.

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

ATM Mux.

Page 25: ReviewCh10-M-M-S

25

Solution

Link speed = 155 Mbit/s = 155 Mbits/s = 155 Mbits/s1 octet = 8 bits transmission time = 53·8/155M = 2.7 s = 124 Mbits/s

The load (utilization) of the link is = 124/155

= 0.8

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

Average number of ATM cells

• M/D/1

4.28.01

8.0

2

18.0

2

N

12

1 2

N

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

8.012

Page 26: ReviewCh10-M-M-S

26

• mean waiting time of the cell in the buffer

(Continue)

801

1

12

11

T

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

s1.8s 7.28.01

8.0

2

11

T

Summary of Comparison

• At heavy loads, the total waiting time of case 3 is the same as in case 1 (in both cases it consists

i l f h i i ) T l i f d bmainly of the waiting). Two slow printers fed by a common queue discharge the work in the queue as efficiently as one fast printer

• Case 2, when the queues are separate, it is possible that one printer stays idle while there are jobs waiting in the queue for the other printer. This deteriorates the overall performance in such a waydeteriorates the overall performance in such a way that also at high loads alternative 2 is on the average times slower than alternative 1

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

Page 27: ReviewCh10-M-M-S

27

References

1. Robert B. Cooper, Introduction to QueueingTheory, 2nd edition, North Holland,1981.Theory, 2nd edition, North Holland,1981.

2. Donald Gross, Carl M. Harris, Fundamentals of Queueing Theory, 3rd edition, Wiley-Interscience Publication, USA, 1998.

3. Leonard Kleinrock, Queueing Systems VolumnI: Theory, A Wiley-Interscience Publication,I: Theory, A Wiley Interscience Publication, Canada, 1975.

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

(Continue)

4. Georges Fiche and Gerard Hebuterne, Communicating Systems & Networks: Traffic &Communicating Systems & Networks: Traffic & Performance, Kogan Page Limited, 2004.

5. Jerimeah F. Hayes, Thimma V. J. Ganesh Babu, Modeling and Analysis of Telecommunications Networks, John Wiley & Sons, 2004.

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