mean delay in m/g/1 queues with head-of-line priority service and embedded markov chains wade trappe

23
Mean Delay in M/G/1 Queues with Mean Delay in M/G/1 Queues with Head-of-Line Priority Service Head-of-Line Priority Service and and Embedded Markov Chains Embedded Markov Chains Wade Trappe

Post on 20-Dec-2015

227 views

Category:

Documents


1 download

TRANSCRIPT

Mean Delay in M/G/1 Queues with Mean Delay in M/G/1 Queues with Head-of-Line Priority ServiceHead-of-Line Priority Service

andandEmbedded Markov ChainsEmbedded Markov Chains

Wade Trappe

Lecture OverviewLecture Overview

Priority Service– Setup– Mean Waiting Time for Type-1– Mean Waiting Time for Type-2– Generalization– Summary

Embedded Markov Chain Technique– Nk inside of N(t)– The queue distribution for M/G/1

The PGF approach– Example: M/H2/1 Queue– Homework: Alternate Pollaczek-Khinchine Derivation

Consider a queue that handles K priority classes of customers– Type-k customers arrive as a Poisson Process with rate and service

times according to .

Customers are separated as they arrive and assigned to different “prioritized” queues

Each time the server is free:– Selects the next customer from highest priority, non-empty queue

– This is the “head of line” service

– We also assume that customers are not pre-empted!

Server Utilization for type-k customers is

Stability requirement:

M/G/1 Priority Services: Setup M/G/1 Priority Services: Setup

1K21

kkk XE

kkX

Priority Services: ExplanationPriority Services: Explanation

Server

Queue-1

Queue-2

1

1

22

1

Blue Type-1 Packets always have priority, but cannot preempt Type-2 packets

Our first goal will be to calculate the mean waiting time for Type-1 customers, i.e.

Assume a type-1 customer arrives and finds Nq1(t)=k1 type-1 already in the queue

Assume we use FCFS within each class

W1 consists of:– Residual time R of customer in server

– k1 service times of type-1 in queue

Thus:

We get the mean waiting time for type-1 as

Priority Services: Mean Waiting TimesPriority Services: Mean Waiting Times

1W

1q1 XENEREW1

1

l1

REW

Now, let us look at a type-2 customer. When he arrives he may find

– Nq1(t)=k1 type-1 already in the queue-1

– Nq2(t)=k2 type-2 already in the queue-2 Thus, W2 is the sum of:

– Residual service time R– k1 service times for type-1customers– k2 service times for type-2 customers– AND service times of any new type-1 customers!!!

We get the mean waiting time for type-2 as

Priority Services: Mean Waiting Times, pg 2Priority Services: Mean Waiting Times, pg 2

112q1q2 XEMEXENEXENEREW21

Priority Services: Mean Waiting Times, pg 3Priority Services: Mean Waiting Times, pg 3

Here, M1 is the number of customers of type-1 that arrive during type-2’s waiting period

By Little’s Theorem applied to the queues:

The mean number of type-1 arrivals during seconds is

Substitute to get

2122112 WWWREW

22q

11q

WNE

WNE

2

1

2W

211 WM

Priority Services: Mean Waiting Times, pg 4Priority Services: Mean Waiting Times, pg 4

Solve for :

Generalizing gives

Now, we’re left with finding E[R]!

121

1

1

21

112

11

RE

1

REWuse

1

WREW

2W

k211k21

k11

REW

Priority Services: Mean Waiting Times, pg 5Priority Services: Mean Waiting Times, pg 5

When a customer arrives, the one being serviced can be of any type! So R must account for this!

We will use the same formulation as

where is the aggregate Poisson Process rate.

To get E[X2] we use the fact that the fraction of type-k customers is :

Thus, we get

2k

22

21

2 XEXEXEXE k21

k1

k211k21

K

1j

2jj

k11

XE

W

2XE2

RE

k

Priority Services: Mean DelayPriority Services: Mean Delay

Now, calculating the mean delay for a type-k customer is easy!

From this, observe:– Class-k customers are affected by the behavior of lower

priority customers

kkk XWT

Embedded Markov Chain Methods Embedded Markov Chain Methods for M/G/1for M/G/1

The Embedded Markov ChainThe Embedded Markov Chain

Let Nk be the number of customers found in the system just after the service completion of the k-th customer

Let Ak be the number of customers who arrive while the k-th customer is served

The Ak are i.i.d.

Under FCFS: Ak is independent of N1, N2, …, Nk-1

Nk is not independent of Ak

Nk-2 Nk-1 Nk

Ck-2 Ck-1 Ck

Time

N(t)

Ck-1

Ck-1

Ck

Ck

Ak-1=1 Ak=3

Ck+1

Xk-1 Xk

Service

Queue

Embedded Markov Chain, pg 2Embedded Markov Chain, pg 2

We may find the following recursion:

Where did first line come from?– If , then k-th customer finds the system empty, and on

departure he leaves behind those who have arrived during his service.

The second line:– The queue left by the k-th customer consists of the previous queue

decreased by one plus the new arrivals during his service.

Let U(x)=1 for x>0 and U(x)=0 for x<=0

Then we get

0Nif1AN

0NifAN

1kk1k

1kkk

0N 1k

k1k1kk ANUNN

Embedded Markov Chain, pg 3Embedded Markov Chain, pg 3

From

we can see that Nk is a Markov Chain since Nk depends on the past only through Nk-1

Nk is called the embedded Markov Chain

(Homework): The distribution for N(t) and Nk are the same:

– Step 1: Show, in M/G/1, distributions found by arriving customers is the same as that left by departing customers

– Step 2: Show, in M/G/1, the distribution of customers found by arriving customers is the same as the steady state distribution of N(t)

We will analyze Nk instead of N(t)

k1k1kk ANUNN

M/G/1 Queue DistributionM/G/1 Queue Distribution

To find the queue distribution, we use the probability generating function method

The PGF of the distribution {pn} is

Substitute and use independence to get

Thus

0n

N

k

nn

kzEzp)z(P lim

k1k1kk ANUNN

01

0k

1n

1nn0k

NUNA

k

p)z(PzpzA

zppzAzEzE)z(P 1k1kklim

zAz

)1z(zAp)z(P

k

k0

M/G/1 Queue Distribution, pg. 2M/G/1 Queue Distribution, pg. 2

If the service time of customer k is t, then Ak has a Poisson distribution with mean t

Now multiply by the fX(t), the pdf of the service time Xk, This gives the joint distribution.

Integrate out X to obtain the unconditional pdf of Ak

What does this remind you of?

Answer: Laplace Transforms!!!

!i

tetXiAP

it

kk

dttf!i

teiAPa X0

it

ki

M/G/1 Queue Distribution, pg. 3M/G/1 Queue Distribution, pg. 3

The Probability Generating Function of Ak is given by

Substitute into earlier result to get:

zf

dttfee

dttf!i

tze

zazEzA

X

X0

tzt

0iX0

it

0i

ii

Ak

k

zfz

)1z(zfp)z(P

X

X0

LaplaceTransformof fX(t)

M/G/1 Queue Distribution, pg. 4M/G/1 Queue Distribution, pg. 4

We need to now find p0!

To do this, look at limit as z goes to 1, and apply L’Hopital…

First, go back to

Observe that P(z=1)=1, Ak(z=1)=1

Thus

We used:

XEdtetftsf

1dttf0f

0

stXXds

d

0

XX

XE1

p

0f1

)0(fp1 0

'X

X0

zAz

)1z(zAp)z(P

k

k0

ShowThis!

M/G/1 Queue Distribution, pg. 5M/G/1 Queue Distribution, pg. 5

Thus,

This is exactly what we got for M/M/1 Queues!!!

Substitute into earlier result to get:

What do we do with this? Use it to find the probability distribution pn!

How? Equate terms… Best to see an example

1XE1p0

zfz

)1z(zf1)z(P

X

X

M/HM/H22/1 Queue/1 Queue

Consider the case where FX(t), the cdf, is a two-term hyper-exponential distribution:

Where do hyper-exponentials come from?– In practice, from situations where service times can be represented as a

mixture of exponential distributions…

– That is, suppose there are k types of customers, each occuring with a probability i (so sum = 1)

– Customer of type I has a service time exponentially distributed with mean 1/i

Then the density is

t2

t1X

21 ee1tF

k

1i

xiiX

iexf

M/HM/H22/1 Queue, pg. 2/1 Queue, pg. 2

Back to our 2-phase hyper-exponential problem…

The mean service time is given by

The Laplace Transform of fX(t) is:

We thus get:

2

2

1

11

ss

sf2

22

1

11X

ii2

2

1

1Xk /for

z11z11zfzA

M/HM/H22/1 Queue, pg. 3/1 Queue, pg. 3

The PGF of {pn} is

The probability distribution is obtained through partial-fraction expansion of P(z).

To do this, we must find the roots of the denominator… call these z1 and z2

Then P(z) has the form:

zz

zC

zz

zC)z(P

2

22

1

11

2211

2121212

21

21

where

1zz

z111zP

= Total Traffic Intensity

M/HM/H22/1 Queue, pg. 4/1 Queue, pg. 4

Solving for C1 and C2 involves setting z=0 and z=1 to get

Finally, upon substitution, we get:

n22

n11n zCzCp

12

122

21

211

zz

z11zC

zz

z11zC