1 Elements of Queuing Theory The queuing model –Core components; –Notation; –Parameters and...

Preview:

Citation preview

1

Elements of Queuing Theory• The queuing model

– Core components;– Notation;– Parameters and performance measures– Characteristics;

• Markov Process– Discrete-time Markov chain;– Continuous-time Markov chain;– Birth-death process;

• Some typical and often-used distributions– Exponential Distribution;– Poisson Distribution;

• M/M/1• Little’s Law• Brief review of M/M/s, M/G/1, M/D/1• Some additional discussions.

2

Queuing Systems

• Core components of the modelCore components of the model– Arrival process– Buffer (the so-called queue)

• Infinite or finite;

– Service process• single or parallel servers

– Service discipline (FIFO, random)

3

Kendall Notation for Queuing Systems (1951)

a/b/s/e/p/d• a, specifies the arrival process

• b, specifies the service process

• s, is the number of parallel servers in the system• e, (usually ) is buffer size (i.e. maximum number of

customers allowed in system)

• p, (usually ) is size of customer population

• d, is the service discipline (FIFO, LIFO, etc.)

4

5

Queuing model parameters

= average rate of customer arrivals

(no. of customers/unit time)

= average rate of customer service by a server

(no. of customers/unit time)

(1/ = average service time)

s = number of servers (channels) in the system

If > s , then . . .

If < s , then . . .

The queuing systems is in steady state when the rate of departures from the system equals the rate of arrivals.

6

Queuing Performance measuresLq = average number of customers in queue

Wq = average waiting time in queue (until service starts)

L = average number of customers in system = Lq + (average number being served)

W = average time a customer spends in system = Wq + 1/

= utilization factor = /(s )

= busy time per unit time for each server

= fraction of time a server is busy (on average)

Pn = the probability (or fraction of time) that exactly n customers are in the system

Pzn = the probability (or fraction of time) that at least n customers are in the system

PW = Pzs = the probability that a customer must wait for service (or the fraction of customers who must wait at least some time in the queue)

7

Customer Arrival Characteristics• Size of the Customer Population

– infinite or finite• assume infinite when rate of customer arrival unaffected by number of

customers in system

• if potential number of customers are limited (e.g. Xerox machines), then if all machines are broken, no more new customer arrivals

• Composition of the Customer Population

– homogeneous or heterogeneous (e.g., the d.s. of interarrivals)

• Customer behaviour– well-behaved (waits until serviced after joining queue)

– balk (leaves queue without joining)

– renege (joins queue, but leaves before service when wait too long)

8

Customer Arrival Process• Interarrival times - the times between successive

customer arrivals.

• A large majority of the arrival patterns in real queuing systems appear to be generated by what is called a Poisson Process, in which the time between successive arrivals is exponentially distributed.

9

Service Characteristics• For each category of customer it is necessary to describe

the service process. This is usually expressed as a probability distribution for service times.

• System configuration– number, type and configuration of servers

– queue capacity

• Queue Discipline– FIFO (first in, first out)

– LIFO (last in, first out)

– priority

– random

10

Markov Process

The probabilistic future of the process depends only on the current state and not upon the history of the process. In other words, the entire history of the process is summarized in the current state.

Markov chain: A Markov process with discrete state space discrete-time Markov chain and continuous-time Markov chain: focus of our further discussions.

11

Discrete-Time Markov chain

12

Discrete-Time Markov chain (cont’d)

A matrix that satisfies the above properties is called a stochastic matrix.A matrix that satisfies the above properties is called a stochastic matrix.

13

Discrete-Time Markov chain (cont’d)

The Chapman-Kolomogorov Equation:The Chapman-Kolomogorov Equation:

14

Discrete-Time Markov chain (cont’d)

Apparently,Apparently,

The matrix form:The matrix form:

15

Discrete-Time Markov chain (cont’d)

Therefore, by solving the system of linear equations defined by:Therefore, by solving the system of linear equations defined by:

Where:Where:

We get the system invariant measure or stable d.f.We get the system invariant measure or stable d.f.

It is not discussed in this course the conditions under which the It is not discussed in this course the conditions under which the above results hold. above results hold. For ones who are interested, pls. refer to corresponding papers or For ones who are interested, pls. refer to corresponding papers or books where detailed discussions or analysis are made. books where detailed discussions or analysis are made.

16

Discrete-Time Markov chain (cont’d)

0 1 0

1/ 4 1/ 2 1/ 4

0 1 0

P

The example:The example: one-step transition matrix:one-step transition matrix:

00 11 22

11 1/41/4

1/41/4 11

1/21/2

The transition diagram:The transition diagram:

0 1 2 0 1 2

0 1 0

( ) 1/ 4 1/ 2 1/ 4 ( )

0 1 0

p p p p p p

The equilibrium equation in matrix The equilibrium equation in matrix notation:notation:

The invariant measure:The invariant measure:

0 1 2( ) (1/ 6 1/ 6 4 / 6)p p p

17

Continuous-time Markov chain

The Chapman-Kolmgorov Equation for C-M.C.:The Chapman-Kolmgorov Equation for C-M.C.:

18

Continuous-time Markov chain(cont’d)

Where:Where:

19

Continuous-time Markov chain(cont’d)

Let be a row vector denoting the invariant measure or

stable d.f. of the system, namly

By solving the following system of equations, we can get the invariant measure:By solving the following system of equations, we can get the invariant measure:

20

Continuous-time Markov chain(cont’d)

It is not discussed in this course the conditions under which the It is not discussed in this course the conditions under which the above results hold. above results hold. For ones who are interested, pls. refer to corresponding papers or For ones who are interested, pls. refer to corresponding papers or books where detailed discussions or analysis are made. books where detailed discussions or analysis are made.

21

Continuous-time Markov chain (cont’d)1 1 0

2 3 1

0 1 1

Q

The example:The example: the Q matrix:the Q matrix:

00 11 22

11 11

22 11

The transition diagram:The transition diagram:

0 1 2

1 1 0

( ) 2 3 1 0

0 1 1

p p p

The equilibrium equation in matrix The equilibrium equation in matrix notation:notation:

The invariant measure:The invariant measure:

0 1 2( ) (2 / 4 1/ 4 1/ 4)p p p

22

Birth-Death Process

23

Birth-Death Process (cont’d)

Then we get the differential equation:Then we get the differential equation:

24

Birth-Death Process (cont’d)

Then we get:Then we get:

Or equivalently:Or equivalently:

The equilibrium equations or the balance equations of a birth and death processThe equilibrium equations or the balance equations of a birth and death process

25

Birth-Death Process (cont’d)

The computation of pThe computation of p00 relies on the fact: relies on the fact:

C<infinite

26

Exponential Distribution(Continuous random variable)

),0( T

Density function:tetf )( for t > 0

CDF: for t 0tetTobtF 1)(Pr)(

= 0 for t < 0

Exp. Value of T

0

)(1

dttft

Variance of T

0

22 dt)t(f)1

t()1

(

27

Exponential Distribution(Continuous random variable)

se)s(F1)sT(obPr Memoryless Property

)tT(obPr

)tTandtsT(obPr)tT|tsT(obPr

t

)ts(

e

e

se

28

Exponential Distribution

0

0.05

0.1

0.15

0.2

0.25

0.3

0.35

1 3 5 7 9 11 13 15 17 19 21

0

0.02

0.04

0.06

0.08

0.1

0.12

1 3 5 7 9 11 13 15 17 19 21

0

0.01

0.02

0.03

0.04

0.05

0.06

1 3 5 7 9 11 13 15 17 19 21

3.0 1.0

05.0

29

Poisson distribution(Discrete random variable)

X {0, 1, 2, 3, ….}

X = 0, 1, 2, …..!x

e)xX(obPr

x

parameter, e = 2.718

Expected value of X = , Variance of X =

)e()3x(obPr

)e()2x(obPr

e)1x(obPr

e)0x(obPr

361

221

30

Poisson Process

31

Poisson Process (cont’d)The counting processThe counting process

Proof:Proof:

32

Poisson Process (cont’d)Proof (cont’d):Proof (cont’d):

For n>0, we have:For n>0, we have:

33

Poisson Process (cont’d)Proof (cont’d):Proof (cont’d):

By noting the initial condition PBy noting the initial condition Pkk(0) = 0, k>0, solving the differential equation (0) = 0, k>0, solving the differential equation

recursively yields the desired results.recursively yields the desired results.

This says, in particular, the mean number This says, in particular, the mean number of events per time unit, or equivalently, the of events per time unit, or equivalently, the rate at which events occur, is given by rate at which events occur, is given by E[N(t)]/ E[N(t)]/ tt = = λ. This is why λ is called the λ. This is why λ is called the rate of the Poisson process.rate of the Poisson process.

34

Poisson Process (cont’d)

Proof:Proof:

35

Poisson Process (cont’d)Additional properties of Poisson Process:Additional properties of Poisson Process:

The inverse is also valid.

36

Catalogue of Queues

• Single server, Poisson arrivals– M/G/1– M/M/1– M/D/1

• Multiple servers, Poisson arrivals– M/G/s– M/M/s– etc, etc,

37

M/M/1

In summary:In summary:1)1) Arrival process is Poisson Process;Arrival process is Poisson Process;2)2) Departure process is Poisson Process;Departure process is Poisson Process;3)3) Service discipline is FCFS;Service discipline is FCFS;

38

M/M/1 (cont’d)

39

M/M/1 (cont’d)

Define:

This parameter is often called the utilization level of the system because it tells This parameter is often called the utilization level of the system because it tells the average load status of the system.the average load status of the system.

1 2 k0 k-1 k+1... ...

The transition diagram:

40

M/M/1 (cont’d)

Ls = Lq +

Ws = Wq + 1/

2

( ) (1 ) i 0 (including the one in service)

E(X) = , expected number of clients in the queue system1-

Expected number of clients waiting for service: 1-

Expected waiting time: (1- )

Expect

ii

K

1ed time spent in the system:

-

P{X K} =

P{a newly arrived client will wait} = 1- (0) =

Throught = (1- (0)) =

41

Little’s Law• Relationship between the performance

measures for any queue.

q

q

LW 1.

Consider one customer:

• wait in queue for • how many people arrive during

this time?• = inter-arrival time

1

qW

2.1

WW q where1 is the average service time

42

Little’s Law

qLL3.

4. WL )1

W(WLL qqq

For each server, expected # customers in service

For s servers, exp. # in services

s

1)busy(P0)idle(P

s

s

43

MultiServer Systems with Exponential Service Times (M/M/s Systems)

= /(s)

Pn =

Lq = [(/ )sP0]/[s!(1- )2]

Ls = Lq + /

Wq = Lq /

Ws = Wq + 1/

1

0

10 /1!//!/)/(/1

s

n

sn ssnP

snfor

nss

P

snforn

P

n

n

!!

)/(

0!

)/(

0

0

1!

)/( 0

s

PP

s

w

44

Queuing Example

• Purchase two facsimile transmission (fax) machine for use of two departments.

• For each dept:

36 /

48 /

/ 36 / 48 0.75

day

day

45

Example: Two separate queues

• Modelled as two separate M/M/1 queues, we get the following performance measures:

items25.24/9)]3648(48/36[L

min40hr3/2day12/1

)day/items3648/(1)/(1W

min30hr2/1day16/1

day)]3648(48/[36)](/[W

2q

s

q

46

• 36/day from Design + 36/day from sales =

72items/day = • M/M/2 system with = 72 items per day and =48 items

per day.

Example: Common pool

min86.22min10min86.12

min86.12214.0268.0]/72/[]93.1[

93.1])4/31(!2/[)]143.0)(4/3()48/72[(

143.07/1]4][2/25.2[5.11

1

)]48)(2/(72(1][!2/)48/72[(!1)48/72(!0/)48/72(

1

22

12100

s

q

q

W

hrdaydayitemsitemsW

itemsL

P

47

Benefits of Pooling Servers

• The result for example 2 holds in general:

If customers are homogeneous, then there will be less If customers are homogeneous, then there will be less customer waiting on average if servers are pooled into customer waiting on average if servers are pooled into one queuing system.one queuing system.

• Notice that in both systems the utilization rates are the same, so the servers do not work any harder or longer in one configuration versus the other.

• Instead, they work more effectively in a pooled system by coordinating their idle time so that a server is never idle while other servers have queues.

• As long as customers can choose which queue to enter and can switch among queues, system with s queues should behave no differently than a system with one queue.

48

M/G/1 Systems• the variance of the service time = 2

/1

/

/

)]1(2/[][ 222

qs

qq

qs

q

WW

LW

LL

L

49

M/D/1 Systems• When the service times are a constant, so that 2=0, we say that the service distribution is deterministic.

• Everything else being equal, the more variation in service times, the longer queues will be on average and the longer customers will wait on average.

)]1(2/[2 qL

50

Role of Variance in Queuing Systems

Everything else being equal, the greater the randomness in arrival times and/or services times, the larger the average queue lengths and waiting times.

• Therefore, anything we can do to reduce variation will help to reduce customer waiting.

• Pacing of customer arrivals reduces waiting• The psychology of queues

– making the waiting time interesting (Disneyland?)

51

52

Capacity Utilization and the Exploding Queue Property

The primary property of queuing systems is that average waiting and queue size increase slowly with utilization until utilization reaches approximately 0.70-0.80. At this point, average waiting time and queue length increase rapidly.

53

FINFIN

Recommended