Single queue modeling. Basic definitions for performance predictions The performance of a system...

28
Single queue modeling
  • date post

    20-Dec-2015
  • Category

    Documents

  • view

    213
  • download

    0

Transcript of Single queue modeling. Basic definitions for performance predictions The performance of a system...

Page 1: Single queue modeling. Basic definitions for performance predictions The performance of a system that gives services could be seen from two different.

Single queue modeling

Page 2: Single queue modeling. Basic definitions for performance predictions The performance of a system that gives services could be seen from two different.

Basic definitions for performance predictions

The performance of a system that gives services could be

seen from two different viewpoints:

• user: the time to obtain a service or the waiting time

before getting a service;

• system: the number of users served in the unit time or

the resources utilization level.

Page 3: Single queue modeling. Basic definitions for performance predictions The performance of a system that gives services could be seen from two different.

Basic definitions for performance predictions

The model can be built analyzing the behaviour of the

system.

SYSTEM

ARRIVALS COMPLETIONS

users servers or resources

Page 4: Single queue modeling. Basic definitions for performance predictions The performance of a system that gives services could be seen from two different.

Arrival rate and throughput

Principal measures:• T: system observation interval;• A: number of arrivals in the period T;• C: number of completions in the period T.

Derived quantities:• λ: arrival rate, λ = A/T;• X: throughput, X= C/T.

Page 5: Single queue modeling. Basic definitions for performance predictions The performance of a system that gives services could be seen from two different.

Utilization factor

For a single server an interesting measure is also the period the server is busy (B).

Then we can obtain:• ρ: server utilization, ρ =B/T;• S: average service completion per request, B/C.

Now it is possible to get the utilization law:

ρ = B/T = S C/T = X S

a special case of the Little’s law

Page 6: Single queue modeling. Basic definitions for performance predictions The performance of a system that gives services could be seen from two different.

Little’s lawDenoting with:• W : the time spent in system by the all requests in T• N: the average number of requests in the system,

N = W/T

• R: the average system residence time per request (average response time),

R=W/C

the Little’s law is equal to: N =X Rgiven that N = W/T= R C/T

Little’s law is very important in the performance evaluation of system consisting of a set of servers because it is widely applicable and does not require strong assumptions.

Page 7: Single queue modeling. Basic definitions for performance predictions The performance of a system that gives services could be seen from two different.

Queuing systems

A system can be modelled by a set of interconnected

queues.

The servers and the users have different

characteristics/behaviors in each queue. If the

queues have an independent each other

behaviour, then each queue can be analysed

separately.

In particular conditions each queue can be modelled

as a Markov chain.

Page 8: Single queue modeling. Basic definitions for performance predictions The performance of a system that gives services could be seen from two different.

Queuing systems

For example a birth/dead process can be used to represent a particular queue in which:

• the inter arrival time of the users is distributed in accordance to the exponential distribution, with arrival rate equal to λ;

• the presence of only one server;• the service time is distributed in accordance to

the exponential distribution, with service time equal to 1/μ.

This kind of queue is denoted as M/M/1

Page 9: Single queue modeling. Basic definitions for performance predictions The performance of a system that gives services could be seen from two different.

M/M/1 queue analysis

Infinite queue

State transition diagram – infinite population

0 1 2 3

. . . .

Page 10: Single queue modeling. Basic definitions for performance predictions The performance of a system that gives services could be seen from two different.

M/M/1 queue analysis

Infinite queue

0 1 2 3

. . . .

State transition diagram with boundaries

Page 11: Single queue modeling. Basic definitions for performance predictions The performance of a system that gives services could be seen from two different.

M/M/1 queue analysis

At every state, in a balanced condition the incoming flow is equal to the outgoing flow.

1

12

01

.

.

.

kk pp

pp

pp

outflowinflow

Page 12: Single queue modeling. Basic definitions for performance predictions The performance of a system that gives services could be seen from two different.

M/M/1 queue analysis

Solving the system:

The sum of the time fractions the system being in all possible states, from 0 to ∞, equals to 1 (probability):

,...2,1,... 021

kpppp

k

kkk

1......0

00

210

k

kkkk pppppp

Page 13: Single queue modeling. Basic definitions for performance predictions The performance of a system that gives services could be seen from two different.

M/M/1 queue analysis

1

1

00

k

k

p

1......0

00

210

k

kkkk pppppp

we obtain

Page 14: Single queue modeling. Basic definitions for performance predictions The performance of a system that gives services could be seen from two different.

M/M/1 queue analysis

It is now possible to calculate the following quantities:

Probability to stay in state k (fraction of time server has k requests):

kk pp 0 where

then Up

k

k

11

1

00

Page 15: Single queue modeling. Basic definitions for performance predictions The performance of a system that gives services could be seen from two different.

M/M/1 queue analysis

The utilization factor:

The expected number of users in the system

Using the “average” definition,

The last sum is equals to U/(1-U)2 for U<1,

1 0 pU

000

11k

k

k

k

kk UkUUUkpkN

)1/( UUN

Page 16: Single queue modeling. Basic definitions for performance predictions The performance of a system that gives services could be seen from two different.

M/M/1 queue analysis

The average response timeUsing the Little’s Law (the average throughput equals to ),

where S=1/ is the average service time of request at the server.

The expected number of users in the queue

The average time in the queue and in the system

)1/()1)(/1()1)(/(/ USUUUXNR

1

2

11

kkpkLE

E[W] E[L]

(1 )E[T]

E[N]

1

(1 )

Page 17: Single queue modeling. Basic definitions for performance predictions The performance of a system that gives services could be seen from two different.

Example (infinite queue)

Arrival rate at the Web server: =30 requests/sec

Average service time: 0.02 seconds

Solution

Average service rate → = 1/0.02 = 50 request/sec

U=/ → U=30/50=0.6 (60%)

p0=1-U=1-0.6=40%

Average number of requests at the server:

N=U/(1-U)=0.6/(1-0.6)=1.5

Average response time:

R=S/(1-U)=(1/ )/(1-U)=(1/50)/(1-0.6)=0.05sec

Page 18: Single queue modeling. Basic definitions for performance predictions The performance of a system that gives services could be seen from two different.

M/M/1 finite queue analysis

Finite queue

State transition diagram – infinite population/finite queue

0 1 2 3

. . .

K. . . .

W

Page 19: Single queue modeling. Basic definitions for performance predictions The performance of a system that gives services could be seen from two different.

M/M/1 finite queue analysis

Using the flow-in=flow-out equations,

We have a finite number of states,

Wkppk

k ,....1,0

1/1

)/(1

...

1

0

00010

W

kW

kW

p

ppppp

Page 20: Single queue modeling. Basic definitions for performance predictions The performance of a system that gives services could be seen from two different.

M/M/1 finite queue analysis

Hence,

The utilization factor:

U=1-p0 →

10)/(1

/1

Wp

10

/1

)/(1)/(

W

W

pU

Page 21: Single queue modeling. Basic definitions for performance predictions The performance of a system that gives services could be seen from two different.

M/M/1 finite queue analysis

The expected number of users in the system

Using the “average” definition:

W

k

kW

kk kppkN

00

0

)/(

)/1(/1

1)/)(1()/()/( 1

W

WW WWN

Page 22: Single queue modeling. Basic definitions for performance predictions The performance of a system that gives services could be seen from two different.

M/M/1 finite queue analysis

The average response time

Using the Little’s Law and S=1/ :

)/1(/1

1)/)(1()/(/

1

W

WW WWSXNR

Page 23: Single queue modeling. Basic definitions for performance predictions The performance of a system that gives services could be seen from two different.

M/M/1 finite queue analysis

Page 24: Single queue modeling. Basic definitions for performance predictions The performance of a system that gives services could be seen from two different.

Example (finite queue)

Arrival rate at the Web server: =30 requests/sec

Average service time: 0.02 seconds

Minimum queue length so that less than 1% of requests are rejected

Solution

Average service rate → = 1/0.02 = 50 request/sec

U=/ → U=30/50=0.6 (60%)

p0=0.4/(1-0.6W+1)

pW=p0(/)W<0.01 → 0.4* 0.6W/(1-0.6W+1)<0.01 →

W≥8

Page 25: Single queue modeling. Basic definitions for performance predictions The performance of a system that gives services could be seen from two different.

Generalized System-Level Models

Using the flow-in=flow-out equations,

0 1 2

. . . .

k

,...2,1,11 kpp kkkk

Page 26: Single queue modeling. Basic definitions for performance predictions The performance of a system that gives services could be seen from two different.

Generalized System-Level Models

By applying recursively,

.

.

.

01

0

2

11

2

12

01

01

ppp

pp

01

0

2

111

1 ... pppk

kk

k

kk

Page 27: Single queue modeling. Basic definitions for performance predictions The performance of a system that gives services could be seen from two different.

Generalized System-Level Models

So,

Since

1

0 10

k

i i

ik pp

10

1

0 10

k

k

i i

ip

Page 28: Single queue modeling. Basic definitions for performance predictions The performance of a system that gives services could be seen from two different.

Generalized System-Level Models

this implies that

 

0

1

0 10

k

k

i i

ip