Upload
kelley-houston
View
217
Download
1
Embed Size (px)
Citation preview
Chapter 6
Queueing Theory
Prof. Bob Li
Typical queueing system are B-D processes
M/M/s M/G/ M/M/1/blockingM/D/1
Interarrival time •Memoryless,•General,•Deterministic, •Uniform, •etc.
Service time is•Memoryless,•General,•Deterministic,•Uniform, •etc.
Number of servers, where 1 s .
Queueing discipline
(optional)
Assumptions and notation. Inter-arrival times are i.i.d. The mean is 1/, while the distribution depends
on the “1st letter” of queueing model. An “M” Def-C of Poisson process. Service times are i.i.d. The mean is 1/, while the distribution depends the
“2nd letter.” An “M” means exponential service time. All inter-arrival times and service times are independent.
• Inter-arrival times are i.i.d. with the mean 1/.• Service times are i.i.d. with the mean 1/. That is, is the capacity of a server. • / = average number of arrivals in a service time = minimum number of servers needed to handle the traffic load = the offered load• Because / is a dimensionless quantity, the telecom community gives it the
artificial unit “erlang.” So, one can say something like“an M/M/2/blocking queue loaded with 1.6 erlangs”
Typical queueing system are B-D processes
M/M/s M/G/ M/M/1/blockingM/D/1
Interarrival time •Memoryless,•General,•Deterministic, •Uniform, •etc.
Service time is•Memoryless,•General,•Deterministic,•Uniform, •etc.
Number of servers, where 1 s .
Queueing discipline
(optional)
6.1
Cost equations, Little’s formula, & steady state
Prof. Bob Li
Four fundamental measures of cost
Prof. Bob Li
Each of the following fundamental quantities represents a way to measure the
“cost of queueing” in the long run:
• LQ = Average Queue Length (not including customers that are being served)
• L = Average population
= Average number of customers in the system
// LQ and L are time-averages, i.e., averages over all nanoseconds until eternity.
• WQ = Average Queueing time of a customer
• W = Average delay of a customer // WQ and W are averages over customers
= WQ + 1/ // Delay = queueing + a service time
// In this formula, 1/ = mean service time. Later // Later when sometimes stands for average output rate, // then W = WQ + 1/ only for single-server system.
Four fundamental measures of cost
Prof. Bob Li
Besides W = WQ + 1/, two Little’s Formulas establish two more relations
among these four measures of cost so that any of them determines the others.
Little’s Formula 1: L = W L W
W = WQ + 1/ (1/ = mean service)
LQ WQ
Little’s Formula 2: LQ = WQ
Little’s Formula 1
Prof. Bob Li
Little’s Formula 1. L = W for all stationary queueing models.
// All stationary models regardless of the arrival process,
// service-time distribution, number of servers, and queueing discipline
Proof. Think of a measure of the cost as money that customers pay to the sys-
tem. In this proof, let each customer in the system pay to the system at the rate
of $1 per unit time.
L = Time-average “rate” at which the system earns// Unit of this “rate” = $/unit time
= Average payment per customer when in the system// Time-ave ave over customers ; Unit of this average = $/person
= W // Unit = (person/unit time)•($/person) = $/unit time
Little’s Formula 2
Prof. Bob Li
Little’s Formula 2. LQ = WQ for all stationary queueing models.
Proof. Let each customer in queue pay $1 per unit time to the system.
LQ = Time-average “rate” at which the system earns
= Average amount a customer pays in queue
= WQ
Four fundamental measures of cost
Prof. Bob Li
We have established relations among these four measures of cost so that any of
them determines the other three.
Little’s Formula 1: L = W L W
W = WQ + 1/ (1/ = mean service)
LQ WQ
Little’s Formula 2: LQ = WQ
Homework. Derive the formula L = LQ + / directly. That is, explain why / is the time-average of the number of customers being served.
L = LQ + /
Prof. Bob Li
Lecture 10
April 3, 2013
6.2
Time average of population in Q
Prof. Bob Li
3 kinds of limiting distributions of population
N(t) = population of the queueing system at time t Pn = , where n 0
= The proportion of time (in the long run) when there are exactly n customers in the system
= Time average // = Average from the outsider’s view
an = Proportion of customers (in the long run) that, upon arrival, see exactly n in the system, n 0 = Arrival-time average // Average over customers rather than time
=
dn = Proportion of customers (in the long run) leaving behind n others to the system upon departure, n 0 = Departure-time average // Average over customers rather than time
=
})({lim ntNPt
0lim lim { ( ) | arrival in ( , )} t h
P N t n t t h
0lim lim { ( ) | departure in ( , )} t h
P N t n t h t
Handicap on arrival- & departure-time averages
The three kinds of averages {Pn}n0, {an}n0, and {dn}n0 are all limiting
distributions of population. They are the same under suitable assumptions in the
sequel but, in general, may differ from each other: Think of the time average as the fair average. The arrival-time average, as a quantity, incurs the handicap of not counting
the arriving customer himself. // Not seeing oneself
Symmetric handicap applies to the departure-time average.
Example. Consider a G/D/1 system such that: Service time = 1 deterministically. Inter-arrival time always > 1. // Not exponentially distributed
Every arriving customer sees an empty system and every departing customer
leaves an empty system behind. Thus, the population seen by an arriving or
departing customer is 0 deterministically. Hence a0 = 1 = d0. However, P0 < 1.
Poisson arrival sees time average
Proposition 8.2. If the arrival process is Poisson, then an = Pn for n 0
Proof.
N(t) is determined by arrivals and departures during (0, t). The Poisson
assumption implies independent arrivals over the two disjoint intervals (0, t)
and (t, t+h). Departures in (0, t) are naturally irrelevant to arrivals in the future
interval (t, t+h). Thus N(t) is independent of arrivals in (t, t+h). Thus,
and an =
// This is the explicit meaning of arrival-time average. =
= Pn
0
lim ( ) | There is an arrival in ( , )
( ) | is immediately before an arrival time
h
P N t n t t h
P N t n t
( )P N t n
{ ( ) }
( ) | There is an arrival in ( , ) for 0}
P N t n
P N t n t t h h
lim ( ) | is immediately before an arrival time
t
P N t n t
lim ( )
t
P N t n
Prof. Bob Li
Poisson departure sees time average?
Symmetrically the handicap of the departure-time average would diminish when the departure process is Poisson.
Prof. Bob Li
However, there is no natural way to create a Poisson departure process starting right at the time 0.
B & D see the same.
Proposition 8.1. In a birth-death queueing system, an = dn for all n 0.
Proof. // When / < s and, in some cases, when / = s, the system converges. // When the system diverges, the Proposition still stands because all an = dn = 0
So, we assume the system converges and reaches stability in the long run. In a B-D system, there is one B at a time and one D at a time. The number of population transitions from n+1 to n during an interval [0, T], for any T, can differ from the number of transitions from n to n+1 by at most 1.
When T , Number of population transitions from n to n+1
= Arrival count in (0, T) [an + o(T)]
= T an + o(T)
Number of population transitions from n+1 to n
= Departure count in (0, T) [dn + o(T)]
= T dn + o(T)
Therefore, 1 =
( )lim
( )
n n
Tn n
Ta o T a
Td o T d
B & D see the same.
The B-D assumption in the above proposition is essential, as evidenced by the
following
Counterexample. Suppose that the unique transportation between the airport
and a distant tourist attraction is a single shuttle bus. Tourists arrive at the attraction gate by bus (The whole bus load is regarded
as arriving at the same time. Thus the queueing system is not B-D.)
Arriving tourists then queue up in front of the ticket window (single server)
and then enter the attraction site one by one. The queue will surely be emptied long before the bus makes another round
trip to and from the distant airport. Thus a0 = 1. However, some departing
customers do leave others behind. Hence d0 < 1.
Corollary. In a stationary B-D queue with Poisson arrival,
Pn = an = dn for n 0
Treat a B-D queue as a continuous-time markov chain. Limiting probabilities
Pj abide with the law of flow balance:
Through telescoping, for all n 0.
If , then and the process will eventually
Become stationary with the limiting probabilities
If , then P0 = 0 and hence Pn = 0 for all n < . That is, as a
continuous-time markov chain, the queue is unstable.
B-D Queue
nnnn PP 11
1 2 00
1 1
n nn
n n
P P
1 0
0 1
n
n n
1
0 1
010
n n
nP
1
0 1
01
11
021
n n
n
nn
nnnP
1 0
0 1
n
n n
Prof. Bob Li
6.3
M/M/s queueing system, 1 ≤ s ≤ ∞
Prof. Bob Li
In an M/M/1, for all n.
Write = / = the offered load
The result on a general B-D process is the reduced to for all n 0.
The queue is stable if and only if or, equivalently, < 1.
When > 1, the queue length grows indefinitely longer and longer.
When = 1, then Pn = 0 for all n. // True for a B-D process in general.
This M/M/1 queue = The symmetric 1-dim random walk with a barrier at 0. // Fold the symmetric 1-dim random walk at the point ½ so that
// every state k, k > 0, coincide with the state k1 for all.
Some consequences are:
1) The empty state will always be renewed, but the average renewal time is . 2) The population will keep achieving new all-time highs.
M/M/1 queue
n and n
0n
nP P
0
n
n
From the equation for all n 0, we find
= n(1) for all n 0
That is, the limiting probabilities Pn are Geometric0(1) distributed.
// Actually this has been derived in Chapter 5 before.
From this distribution, we derive:
The fraction of time 1P0 that the single server is working is called the
utilization. In this case, the utilization 1P0 = = the offered load.
The average population is
L =
// Mean of Geometric0(1)
From L we can calculate
W, WQ, and LQ .
Stable M/M/1 queue ( < 1)0
nnP P
/nnP
0
n
n
10nnnP
We now calculate the distribution of the delay for an average customer in M/M/1. The distribution refers to data sampling over all departing customers in all time. It is the same as the delay of a customer in the steady state.
Proposition. The delay of a customer in a stationary M/M/1 queue is Exponential() distributed.
Proof. Let an arriving customer in the stationary M/M/1 sees X customers in the system. Since Poisson arrival sees time average, X is Geometric0(1) distributed, same as the limiting probabilities Pn of the M/M/1.
Let the r.v. W* represent the delay of a customer in a stationary M/M/1 queue, which is the sum of X+1 service times.
// We have being using the capital letter W for the average waiting time of a customer.
// However, we normally use capital letters for r.v. So, we need here a “super-capital”
// notation for the r.v. representing the delay in the stationary state. Note that EW* = W.
As X+1 is Geometric1(1) distributed, W* is Exponential((1)) distributed.
// See the Waiting for Godot problem on the next slide.
Distribution of M/M/1 delay
Problem. Buses arrive according to a Poisson process with the intensity , and
it takes X buses to wait for Godot, and X is Geometric1(1) distributed. What is
distribution of the arrival time W* of Godot.
Proof. Thus W* is a sum of memorylessly many memoryless i.i.d. Claim that
W* is a memoryless r.v., that is, under the condition of W* > w, the residual
waiting time for Godot has the same distribution as the unconditional W* itself.
In fact, under the stronger condition (more specification) that
x buses have passed and the waiting time for the next bus > y
the residual waiting time still has the distribution of the unconditional W*,
which is therefore exponentially.// The sum of Geometric0(1) many exponential r.v. incurs a pointed prob. mass at 0.
The rate of this exponential distribution is the reciprocal of the mean, which is
W = E[W*] = (EX+1)/ = 1/(1) = 1/()In conclusion, the arrival time W* of Godot is Exponential() distributed.
Waiting for Godot
Alternative proof by calculation. Under the condition of seeing n in the system
upon arrival, the residual service time has the same distribution as a complete
memoryless service time. Thus the conditional r.v.
(W* | Seeing n in the system upon arrival)
is Gamma(n+1, ) distributed.
P{W* a}
= n0 P{n in the system upon arrival}P{W* a | n in the system upon arrival}
= n0 PnP{W* a | n in system upon arrival} // Poisson arrival sees time average.
= n0 [Pn ] // W* is Gamma(n+1, ) density function
= n0 [(1)n ] // Pn is Geometric0(1) distributed
= n0 [ ]
= …
Distribution of M/M/1 delay
a
nt dt
n
te
0 !
a
nt dt
n
te
0 !
n
1
an
t dtn
te
0 !
P{W* a} = …
= n0 [ ]
= () n0 [ ]
= () // Interchanging order
= () dt
= 1 |x = a
= 1
Alternative proof (cont’d)
n
1
an
t dtn
te
0 !
0 !
na t te dt
n
a
0[
0
]!
n
t
n
te dt
n
a
0[ te te
( ) xe
ae )(
Prof. Bob Li
M/M/1/blocking queue with a finite capacity
N
Example. The buffer of a processor can hold at most only N1 jobs in the queue
(plus another job being processed). // Here N is a deterministic integer.
M/M/1 is a birth-death Markov process regardless of the queueing discipline.
Again, time reversibility leads to for 0 n N.
For the M/M/1/blocking queue,
0n
nP P
,10
Ni iP
NnP
P
PP
N
n
n
N
NN
n
n
0for 1
1
1
1
1
11
1
10
0
1
00
// This formula stands regardless of how large is,
// because the queueing discipline of blocking sets an
// upper bound on the population and thereby
// precludes divergence. In other words, regardless of
// the traffic load, the fraction of arrivals that actually
// enter the system makes a load below 1.
M/M/1/blocking queue with a finite capacity
Example. The buffer of a processor
can hold at most only N1 jobs in the
queue (plus another job being
processed). // Here N is a deterministic integer.
The average population L is:
1
1for 0
1
n
n NP n N
0
10
11
0
10
1
1
1
21
1
1
// Key step in
1
1
1
1
1 d
1 d
1 d 1
1 d 1
1 1 11
1
calculat
1
1 1
1
ion
N
nn
Nn
Nn
Nn
Nn
Nn
Nn
N
N
N N
N
N N
N
L nP
n
n
N
N N
when 1 and
1
N
M/M/1/blocking queue with a finite capacity
Example. The buffer of a processor can hold at most only N1 jobs in the queue
(plus another job being processed). // Here N is a deterministic
integer.
From the formula for L, we can also derive the formula for W, the average delay
of a customer by Little’s Formula W = L/. Note that the arrival rate includes
blocked customers and hence this average W counts blocked arrivals as
customers with zero delay.
The fraction of arrivals that actually enter the system is 1PN. If the delay is
averaged only among the entering customers, then the actual arrival rate is a =
(1PN) and hence the average delay is Wa = L/a = L/[(1PN)].
// As N , 0 and thereby a and WaW
1
1
1
N
N NP
Prof. Bob Li
M/M/s without buffering space (Erlang Loss System)
Example. At a parking lot with the capacity of s automobiles, arrivals at a full lot are immediately turned away.
Example. An old telephone exchange is equipped with s digit receivers shared by all ports. Call arrivals are blocked when all digit receivers are busy.
A stable B-D process is time-reversible. Its stationary probabilities abide with the simplified laws of flow balance: Pn1 = n Pn for 0 < n s.
Or, equivalently, Pn = Pn1 / n = Pn1 / n for 0 < n s
Prof. Bob Li
s
M/M/s without buffering space (Erlang Loss System)
Prof. Bob Li
s
1 0
2 1
1
2
s s
P P
P P
P Ps
0 0
!0
!0
// Erlang B (bloc
1 for
king)
and !
1 Fo ula
!rm
m
m
n
n s
mm
n
n s
mm
P P n s Pn
Pn
M/M/s queue with infinite buffering capacity
. . .
Laws of flow balance are: Pi = Pi1 / i = Pi1 / i for 0 < i < s and
Pi = Pi1 / s = Pi1 / s for i s
s
1 0
2 1
1
1
2
s s
s j s j
P P
P P
P Ps
P Ps
0
0
0 1
0
for !
for 0,
// Erlang C F
!
1w
or
her
mula
e
! ( 1)! ( )
n
n
n s n
s n sn n
n ss
n
P P n sn
P P P ns s s
P
n s s
An exemplifying problem. A two-seat cable car serves two customers simultaneously when there are two or more customers present in the queue. When the system is empty, the cable car waits for the next arriving customer. The service time is Exponential() whether one or two customers are served.
Model as a continuous-time markov chain. In order to calculate the limiting probabilities, we treat this queueing system as a continuous-time markov chain where the “state” is labeled by the queue length rather than the population. There are two different states corresponding to an empty queue:
• State 0 the queue is empty but the server is busy
• State 0 the whole system is empty
M/M/1 queue with bulk service
Prof. Bob Li
M/M/1 queue with bulk service
The straightforward form of flow balance in the stationary state follows the red
cuts. Taking advantage of the fact that all states in this transition diagram almost
line up in a row, there is the better alternative of blue cuts that intersect with
fewer transition arrows. // similar to time reversible M
C
vs.
Either one consists of homogeneous difference equations. // Discrete counterpart to homogeneous differential eq.
It is clear that , and we shall try a solution in the form of // Discrete counterpart to trying f(x) = kex
0 0
0 0 1 2
1 2 for 1n n n
P P
P P P P
P P P n
0 0
0 1 2
1 2 for 1n n n
P P
P P P
P P P n
0 0 /P P 0n
nP P
M/M/1 queue with bulk service
It is clear that , and we shall try a solution in the form of
vs.
The only feasible root is
The geometric form of the solution shows that:
The system is stable < 1
< 2
< 2// 2 is the maximum service rate. Hence must be strictly less than 2.
0 0 /P P 0n
nP P
1 20 0 0
3
3 1 0
1 1 41 or
2
n n nP P P
1 20 0 0
1 2
2 0
1 1 4
2
n n n
n n n
P P P
1 1 4
2
M/M/1 queue with bulk service
The boundary condition translates into
In the stable case,
0 01
1nn
P P P
01
1 1n
n
P
0
0
1 11
11
1
P
P
0
0 0
1
1
1 ,
//
01
1 0
1
n
n
P
P n
P P
Prof. Bob Li
Homework. What can you say about a 3-seat cable car?
M/M/1 queue with bulk service
The average number of customers in the queue is
1
1
1
1
1
2
1
1
1
1
1
1
1 d
1 d 1
1 1
1
1
d
d
1
1
Q nn
n
n
n
n
n
n
L nP
n
n // This is similar to the mean of a geometric distribution.
6.4
Network of queues
Prof. Bob Li
Tandem of an M/M/1 queue and a ~/M/1 queue (“~” refers to whatever is output by the M/M/1 queue.)
To consider the stationary situation, we assume that < 1 and < 2.
Since Queue 1 is M/M/1 and < 1, its stationary population is Geometric0(1/1)
distributed. That is,
Moreover, the stationary output from Queue 1 is a Poisson process at the intensity by Burke’s Theorem. // Burke’s Thm applies more generally to M/M/s with < s.
Thus, when Queue 1 reaches equilibrium, Queue 2 becomes another M/M/1.
Since < 2. Queue 2 later also reach a stationary Geometric0(1/2) distributed
population.
1 1
at queue 1sta 1tionaryn
P n
Prof. Bob Li
Tandem of an M/M/1 queue plus a ~/M/1 queue
The following argument proves independence between the populations of the
two individual queues in the stationary state and, in particular, in the stationary
state.
Population of Queue 1 is independent of the future arrival times. By time
reversibility of a B-D process, the stationary population is also independent
of the future arrival times in the reversed process, which are the past
departure times in the forward process. In short, the stationary population of
Queue 1 is independent of its past departure times. On the other hand, the past departure times are the only thing from Queue 1
that affects the status of Queue 2 at any moment.
Prof. Bob Li
Tandem of an M/M/1 queue plus a ~/M/1 queue
Therefore the joint limiting probabilities are simply:
Average population in the tandem network is
From Little’s Formula,
// Average delay in going through the whole tandem
2211
,
11
2 queueat 1 queueat
2 queueat ,1 queueat
mn
mn
mPnP
mnPP
1 21 2
L L L
21
11LW
Prof. Bob Li
Alternative derivation without using time reversibility
Prof. Bob Li
mnmnmnmn
mmm
nnn
PPPP
PPP
PPP
PP
,11,111,2,21
1,111,02,02
0,11,20,1
1,020,0
, n mn m n mP P P K
21
and
Laws of flow balance are:
These are 2-variable homogeneous
difference equations. So, we try a solution
in the form of
Luckily, it works with
Normalization of probability then gives
K = (1)(1)
A markov chain with states (i, j), where i, j 0:
skipRemarks on stationary state(1) Let the random variables N* and M* represent the stationary populations in the two
queues seen by customers upon entering the respective queues. Since Poisson
arrival sees time average, N* and M* also represent the time averages, which are
independent of each other from the above calculation.
(2) On the other hand, the two stationary populations N* and M that a particular
customer sees upon entering the respective queues are not independent in general.
Example. When is small in comparison with 2, P{M* > 0} = /2 is also small.
Assume also that 1 = 2. There is a correlation between the two stationary
populations that a particular customer sees upon entering the respective queues,
because
• P{A customer sees M > 0 | The same customer saw nonempty Queue 1 upon
entering Queue 1} ½
skipRemarks on stationary state (cont’d)
(3) The stationary delay in Queue 1 is Exponential(1). Remarkably enough, M is
independent of this stationary delay and hence the delay times that a customer incurs at
the two queues are independent. It is an open problem to find a simple explanation
for this fact.N*
M
Service time in Q1
Waiting time in Q1
Independent! The positive and negative correlations cancel out.Any simple explanation?
Positive correlation
Independent
Negative correlation
DependentAlmostproportional
Delay in Q1
General (open) system of queues
There are K nodes in the network. Each node j consists of sj exponential servers, each at the rate j.
Customers arrive from outside the system to each node j in accordance with an independent Poisson process at the rate rj.
Once a customer is served by a server at node i, he joins the queue of node j
with probability Pij and departs from the system with the probability .
We are interested in the stationary probability P(n1, …, nK) = P(There are nj customers at each node j)
1
1K
ijj
P
General (open) system of queues
Let j denote the stationary output “rate” of node j.// Our language: rate = memoryless rate; while “rate” = any average per unit time
The stationary probability P(n1, …, nK) must abide with Law of Flow Balance: j
is equal to the total “rate” of customer arrivals at node j from both inside and
outside of the stationary system. That is,
K
iijijj Pr
1
Prof. Bob Li
Prof. Bob Li
General (open) system of queues
Jackson’s Theorem. Assume that for j = 1, 2, …, K. Then,
where Pj(nj) is the limiting probability of an M/M/sj queueing system with the
arrival rate j and the service rate j for each server.
// It is as if there were an independent M/M/sj queue at each node j.
Proof. The solution magically abides with all the laws of flow balance.
Open problem. Find a non-calculative explanation of Jackson’s Theorem.
j j js
KK2211K1 ,, nPnPnPnnP
The case with a single server at every node
The total arrival process to a node j is not Poisson initially and not clear even in equilibrium. However, the stationary population at each node j has an independent geometric distribution, which is the same as an M/M/1 queue with the arrival intensity j.
The joint distribution P(n1, …, nK) is the same as the joint distribution of K independent M/M/1 queues.
The average time a customer spends in the network is, by applying Little’s Formula to the whole network,
1 , 1server at customer
njnP
j
j
n
j
j
K
j j
j
n
j
jKnnP
11 1,,
K
j jj
jK
j
jL11
server at number average
1 1
/
j
j j
K K
jj j
LW r
Exemplifying network of two single-server queues
½
¼
Poisson(4) external input
½
¾
1 = 8
2 = 10
Poisson(5) external input
Following previous notation,
1 2 2 1
1 2
1 21 2
1 2
1 14 and 5
4 26 and 8
Hence
3 4and
4 5
mn
mn
,mnP
5
4
4
3
20
1
5
1
5
4
4
1
4
32server at 1server at
1
1
6 87
8 6 10 8
7
4 5 9
Kj
j j j
K
jj
L
L LW
r
Prof. Bob Li
Two single-server queues in a feedback loop
Prof. Bob Li
p
Poisson() external input q
1
2
Following previous notation,
1 2 2 1
1 2
and
/ and /
p
q p q
nm
nm q
p
q
p
qqP
2211, 11
1
Kj
j j j
L
LW
skipDirect derivation of the formula for Pm,n
p
Poisson() external input q
1
2
// instead of using Jackson’s Theorem
The possible transitions:
Current Next Average “rate” state state of transition (m, n) (m+1, n) Arrival of new customer
(m, n) (m+1, n1) 2 Feedback to Server 1
(m, n) (m1, n) q1 Departures of customer
(m, n) (m1, n+1) p1 Feedback to Server 2
Corresponding laws of flow balance:
1,12,11
1,11,1,21
1,120,110,10,1
,111,11,02
0,110,0
nmnm
nmnmnm
mmmm
nnn
PPq
PpPP
PPqPP
PqPpP
PqP
Solve for Pm,n.
Prof. Bob Li
Lecture 11
April 10, 2013
6.5
M/G/1 queueing system
Prof. Bob Li
Prof. Bob Li
A lemma for a general system// Such as G/G/s with possibly some blocking
The main goal of this section is to calculate WQ.
Convention for a general system. = time-average of entering customers per unit time
// = arrival “rate” when there is no blocking
// = arrival rate in the special case of M/G/s
WQ* = an r.v. representing the waiting time of an entering customer
S = an r.v. representing a service time
For a customer being served, the “remaining service time at time t” measures the part of his service time after the time point t.
When a customer is in queue at time t, the “remaining service time at time t” is whatever duration his service time will turn out to be.
A lemma for a general systemLemma 1. Let each customer in the system at any time pay money to the system at the rate equal to his remaining service time. Then, . Average earning rate of the system // Time average = E[Total payment by a customer] // Average over customers = E[SWQ*] +E[S2]/2 // Sum of averages of r.v.
// Remaining service time is unknown until departure. Payment has to be retroactive.Proof. Whole amount paid by a customer when in queue = SWQ* // S and WQ* are r.v.
Whole amount paid by a customer during his service = S2/2 // t = age of service
Arrival time
Service
begins.
Departure time
SWQ*
S
A lemma for a general system
Proof. … Following the same kind of argument in Little’s Formulas 1 and 2,
Time average of earning rate from all customers in queue
= E[Amount paid by a customer when he is in queue]
= E[SWQ*] (8.30a)
Time average of earning rate from all customers during their services
= E[Amount paid by a customer during his service]
= E[S2/2] (8.30b)
Time average of earning rate of the system // Time average
= E[Total payment by a customer] // Average over customers
= E[S WQ* + S2/2] // Average of an r.v.
= E[S WQ*] + E[S2]/2 (8.30)
Prof. Bob Li
Lemma 2: Poisson arrival sees time average
Lemma 2. Consider a general queueing system with Poisson arrivals. Let each customer at any time pay money to the system at the rate equal to his remaining service time. Then, arrival-time average of the system earning rate is equal to time average.
Proof. Let X(t) denote the cumulative system earning during the interval (0, t).
Time average of system earning rate =
On the other hand, Arrival-time average of system earning rate
= …
X( )lim Et
t
t
0
X( )lim lim E | There is an arrival in ( , )
t h
tt t h
t
Prof. Bob Li
Lemma 2: Poisson arrival sees time average
=
=
= Time average of system earning rate
0
X( )lim lim E | There is an arrival in ( , )
t h
tt t h
t
0
X( )lim lim Et h
t
t
// System earning during (0, t) is completely determined by:
// (a) arrival times during (0, t) and
// (b) departure times of those customers that arrive during (0, t).
// (a) is irrelevant to arrivals in (t, t+h) because:
// Poisson input independent arrivals over disjoint intervals
// (b) is irrelevant to arrivals in (t, t+h) because FIFO service
// System earning rate at t is independent of arrivals in (t, t+h) X( )lim Et
t
t
Prof. Bob Li
Pollaczek-Khinchin (P-K) formula
Theorem (P-K Formula). WQ = E[S2] / 2(1ES) for an M/G/1, where is the arrival rate and S is the r.v. representing a service time.
// From WQ, we can derive W, LQ and L as usual.
Proof. We shall derive a linear equation for WQ: WQ = ES WQ + E[S2]/2 // The derivation utilizes 3 properties of the M/G/1 queue:
• A single server • Poisson arrival • Independence between the service time S and the waiting time WQ* of a customer
WQ // = E[WQ*]
= Departure-time average of waiting time // Average over all customers in the long run= Arrival-time average of waiting time // Because of B-D
= Arrival-time average of (sum of remaining service times of those customers seen by the arriving customer) // Because of the single server
= Arrival-time average of system earning rate= Time average of system earning rate
// Lemma 2: Poisson arrival sees time average.
Pollaczek-Khinchin (P-K) formulaTheorem (P-K Formula). WQ = E[S2] / 2(1ES) for an M/G/1, where is the arrival rate and S is the r.v. representing a service time.
// From WQ, we can derive W, LQ and L as usual.
Proof.
WQ = …
= Time average of system earning rate
= E[Total payment by a customer] // By Lemma 1
// E[Total …] is an average over all customers.
= E[S WQ*] + E[S2/2] // averages of r.v., also by Lemma 1
= ES E[WQ*] + E[S2]/2 // S is independent of WQ*
= ES WQ + E[S2]/2
We arrive at the equation WQ = ES WQ + E[S2]/2
Therefore, WQ = E[S2] / 2(1ES)Prof. Bob Li
Paraphrasing of proof
WQ ==== Dep-time ave. of queueing || B-D
Arr-time ave. of queueing || Single server
Arr-time ave. of (remaining)
|| Time ave. of earning rate ======= Arr-time ave. of earning rate
Lemma 1 Lemma 2: Poisson arrival sees time ave.
=========== E[Total payment of a customer]
|| Also by Lemma 1
E[SWQ*] + E[S2]/2 || Indep. between S and WQ*
ESWQ + E[S2]/2
Time averages Averages of r.v. Departure/arrival-time averages
Prof. Bob Li
6.6
G/M/1 queueing system
Prof. Bob Li
Arrival-time markov chain of G/M/1
The arrival is not memoryless, so the number of customers in the system is not informative enough to serve as the “state.” The missing information is the age of the last arrival. To circumvent this deficiency, we shall examine the markov chain at just the arrival times. Denote
Xn = the number of people seen by the n-th arrival
This defines the (discrete) arrival-time markov chain {Xn}n1. From a state Xn = i,
a transition is to Xn+1 = i+1–Y, where Y is the number of service completions
during the inter-arrival time. Under the condition of an inter-arrival time t, the distribution of Y is Poisson(t) but truncated by the upper bound i+1, which is the population right after the n-th arrival. // Remaining probability goes to i+1.
Write G for the distribution function of an inter-arrival time. The said transition probability is:
Pi,i+1y = , 0 y i // And remaining probability goes to y = i+1.
or Pi,k = , 1 k i+1 // Remaining probability goes to Pi,0.
0
( )( )
!
yt t
e dG ty
1
0
( )( )
( 1 )!
i kt t
e dG ti k
Stationary state of the arrival-time markov chain
The stationary state {i}0i< of the arrival-time markov chain abides with
or (8.48)
with the normalization of j j = 1. To solve the integral equations (8.48), try a solution in the form of a geometric distribution:
k = (1 ) k // This is not a wild guess; explained in Ross book. is the
// proportion of customers that see at least 1 upon arrivals. Equations (8.48) become
// May solve numerically. For M/M/1, = is a solution.
1k i ik
i k
P
1
01
( )( )
( 1 )!
i kt
k ii k i
te dG t
k
1
k i
i k
1
0
( )( )
( 1 )!
i kt t
e dG ti k
0
1
1
1 )()!1(
)(tdG
ki
te
ki
ki
kt
0
1 )(tdGee tkt
0
)1( )(tdGe t
Delay and waiting time analysis
Let the r.v. W* represent the delay of a customer in the stationary state. If this customer sees Y upon arrival, then W* is the sum of Y+1 Exponential() i.i.d. Since Y+1 is Geometric1(1) distributed,
• W* is exponential with the mean W // Waiting for Godot
Hence WQ = W 1/
Let the r.v. WQ* represent the waiting of a customer in the stationary state. Then,
P{WQ* = 0} = P{Sees 0 upon arrival} = 0 = 1. // Pointed prob. mass
The conditional r.v. (WQ* | Sees at least 1 upon arrival) has the same distribution as W*.
Denote the mean inter-arrival time by 1/. Then,
L = W and LQ = WQ
)1(
0)(tdGt
)1(
)1(
1 1
1
Prof. Bob Li
Time average of population
For a stationary G/G/1 system,
• The “rate” at which the population changes from k1 to k
= (Arrival “rate” ) (Proportion k1of arrivals that see k1 in the system)
// Similar argument to Little’s Formulas
• The “rate” at which the population changes from k to k1
= (Time average Pk of the probability of a population k) (service “rate” )
Since a G/G/1 queue is a B-D process, the above two “rates” of changes must be
equal. Thus k1 = Pk. Therefore,
• Pk = (/)k1 for k > 1 and P0 = 1 /
Prof. Bob Li
G/M/1 time average of population
For a stationary G/G/1 system,
• The “rate” at which the population changes from k1 to k
= (Arrival “rate” ) (Proportion k1of arrivals that see k1 in the system)
// Similar argument to Little’s Formulas
• The “rate” at which the population changes from k to k1
= (Time average Pk of the probability of a population k) (service “rate” )
Since a G/G/1 queue is a B-D process, the above two “rates” of changes must be
equal. Thus k1 = Pk. Therefore,
• Pk = (/)k1 for k > 1 and P0 = 1 /
For a stationary G/M/1 system in particular, we have calculated
k = P{arrival sees k in the system} = (1) k
// where is the solution toHence Pk = (/)(1)
k1 for k > 1
(1 )
0( )te dG t
6.7
Busy and idle periods
Prof. Bob Li
Average length of a busy period
Whenever the system becomes idle, the initial state is renewed. A renewal
interval consists of an idle period followed by a busy period. A renewal time is
measured from one renewal to the next. The renewal times are i.i.d.
Lengths of the idle periods I1, I2, … are also i.i.d., since each of them is the
waiting time from a renewal till the next arrival. Consequently, lengths of the
busy periods B1, B2, … are also i.i.d.
A general queueing system, such as G/G/s, the population at an arrival time is
not informative enough to describe the system. Is there any simplified markov
chain naturally imbedded inside?
One way is to classify the population as just empty and nonempty.
Let the system starts empty. The system alternates between idle periods and
busy periods.
Prof. Bob Li
Recall the notation P0 = P{Stationary system is idle}. // An average over time By the strong law of large numbers,
with probability 1
with probability 1
where the r.v. I and B, respectively, represent the duration of an idle period and a busy period in the steady state. This establishes an equation for a general queue:
P0 (8.35)
10
1 1
lim n
nn n
I IP
I I B B
1
1 1
1
1 1
/lim
/ /
lim /
lim / lim /
n
nn n
nn
n nn n
I I n
I I n B B n
I I n
I I n B B n
Average length of a busy period
E
E E
I
I B
E
E E
I
I B
Average length of G/G/1 busy period
For a G/G/1 queue, P0 can be calculated by:1 P0
= P{A single customer is being served.}
= E[Number of customers being served] // Mean of a 0/1 r.v.
= 1/ // Little’s Formula on no. of customers being served
Thus, P0 = 1/ = 1 (8.37)
// = the arrival “rate” and 1/ = the mean service time
(8.35) and (8.37) together give
1 (8.35a)
To calculate EB and EI, we need a second equation.
Prof. Bob Li
E
E E
I
I B
Average length of M/G/1 busy period
Theorem. for a steady M/G/1 queue.
Proof. In the case when arrival is memoryless,
(8.36)
// When arrival is not memoryless the idle time I is only part of an inter-arrival time.
(8.36), together with (8.35a) proves the theorem.
1EI
1E
B
Corollary. In a steady M/G/1 queue, the average number of services in a busy
period is
Proof. Let the r.v. C represent the number of services in a busy period.
Then, EB = EC·1/. Thus, EC = EB
1
1
Prof. Bob Li
Busy and idle periods
Prof. Bob Li
For the G/G/1 queue, we have
(8.35a)
Other than an M/G/1 queue, it requires one more equation to determine EB
and EI. // When arrival is not memoryless the idle time I is only part of an inter-arrival
time.
Below we shall derive the extra equation for G/M/1.
E
E
I
B
Busy and idle periods
A busy period followed by an idle period= A renewal interval = The accumulation of N consecutive interarrival times T1, T2, … , TN, where the
r.v. N represents the number of services in the busy period. EB + EI= E[Length of a renewal interval]= E[T1 + T2 + … + TN]
= EN ET1 // N is a stopping time of the process T1, T2, …, because TN is
// the first arrival in the busy period that sees an empty system.
= EN/
Time
Renew Renew Renew
N=3 service times in B I N=5 service times in B I
T1 T2 T3
Busy and idle periods
On the other hand,
1/EN
= The proportion of arrivals that are renewals
= 1 for a G/M/1 queue // where is a solution of
This is the extra relation we need. In conclusion, for a G/M/1 system,
EB = and EI =
Time
Renew Renew Renew
N=3 service times in B I N=5 service times in B I
T1 T2 T3
(1 )
0( )te dG t
)1(
1
)1(
Prof. Bob Li
M/G/1 busy period distribution
To determine the distribution of a busy period of an M/G/1, we shall deal with the Laplace transform of this distribution. Let the r.v. S stands for a service time
Theorem. Write
• • Then, B() satisfies the equation
Proof. A busy period is started by the arrival of a customer during an idle period. Starting with the service time of this customer, all service times in the busy period are organized into a family tree: When customer arrives during the busy period, the service time of this
customer is regarded as a “son” of the ongoing service time.Since permutation of customers in the queue does not affect the busy period, we may let customers be served in the “depth-first” order of the family tree.Let the r.v. A represent the number of arrivals during the service of a customer. Thus a service time has A sons, which engender A busy periods represented by the i.i.d. B1, B2, …. BA.
* // Laplace transform of the r.v. BB E e B * // Laplace transform of service time S
SF E e S *** BFB S