o3(112) ffi p3(011) u3/CAP,~(I). = 2Ã2 = 4. 13(2). = 2xp3(212 ) + lxp:,(! 12) = 8. 6(2) + 12(2) +/3(2). G(2) = ffi 8.5. 2 p~(012) = G(2) - pa (212) - pa (1 [ 2) = 2.5.
1. Introduction
Systems Modeling and Performance Evaluation
H.D. Schwetman Editor
Computational Algorithms for Product Form Queueing Networks K. Mani Chandy University of Texas at Austin Charles H. Sauer IBM Thomas J. Watson Research Center
In the last two decades there has been special interest in queueing networks with a product form solution. These have been widely used as models of computer systems and communication networks. Two new computational algorithms f•r product form networks are presented. A comprehensive treatment of these algorithms and the two important existing algorithms, convolution and mean value analysis, is given. Key Words and Phrases: performance evaluation, queueing networks, product form CR Categories: 4.32, 4.6, 6.20, 8.1
Permission to copy without fee all or part of this material is granted provided that the copies are not made or distributed for direct commercial advantage, the ACM copyright notice and the title of the publication and its date appear, and notice is given that copying is by permission of the Association for Computing Machinery. To copy otherwise, or to republish, requires a fee and/or specific permission. Authors' present addresses: K.M. Chandy, Department of Computer Sciences, University of Texas, Austin, TX 78712; C.H. Sauer, IBM Thomas J. Watson Research Center, P.O. Box 218, Yorktown Heights, NY 10598. © 1980 ACM 0001-0782/80/1000-0573 $00.75.
573
Queueing systems have been of interest to applied mathematicians since the turn of the century when Erlang used them as models of telephone systems. In the '50s and early '60s Jackson showed [8] that a certain class of networks of queues has a product f o r m solution in the sense that P(S1, S2 . . . . .
SM) --
Pa(S1)P2(S2) . . . PM(SM) G
(1)
where P(S1, $2 . . . . . SM) is the probability of a network state in a network with M queues, Pm(Sm), 1 M
(9)
E r+ Q + ( n )
i=1
Applying the classic statement of Little's rule, we also have
N.
Then
Ltm)(n ) = R(m)(n) Qtm)(n).
G = X t n * X * . . . * X.
Since we know that Ltm>(O) = O, m = 1. . . . . M, we can iteratively determine Qtm>(n), Rim ) (n) and L(m)(n) for n
Performance measures can be obtained from these vectors. For example, the throughput through queue m given population N, which we represent as Rim)(N), can be obtained as G(N1) R t m ) ( N ) = rim> G(N)
(6)
Let P ( m ) ( n [ N ) be the probability of queue length n at queue m given population N, i.e., the queue length distribution. (We will assume that queue lengths and queueing times include jobs in service.) Let GM-(m) be the normalization constant for the network with queue m omitted. GM-(m) can be obtained from G and Xtm>, but such an approach has poorer numerical properties than computing GM-(m)directly [14]. (Such direct computation will require significant additional storage a n d / o r redundant computational effort.) Then
= Xtm>(n)GM-tm)(N - n) G(N)
for n = 0 . . . . . N.
(7)
3.3 LBANC 3.3.1 Single c l o s e d chain. LBANC depends on Little's rule equivalents of eq. (8) and the corresponding equations for other CAP functions; thus LBANC may be derived from mean value analysis. Unlike mean value analysis, LBANC explicitly requires normalizing constants (G). Let l(,">(n) be the unnormalized mean queue length of queue m given population n, where (11)
l(m) (n) = Ltm> (n) G(n)
LBANC yields unnormalized mean queue lengths as intermediate results. From the fact that
3.2 M e a n V a l u e A n a l y s i s
Let Ltm)(n) be the mean queue length at queue m given population n, and let Q(m)(n) be the mean queueing time at queue m given population n. As demonstrated in [15], the key to mean value analysis is the following equation for single server fixed rate queues: 1
a(m)
(1 + L t m > ( n - 1)).
we get
l~m~(n)
Utilizations and mean queue lengths can be directly obtained from the queue length distribution and mean queueing times from Little's rule [11]. (For some interesting special cases we can obtain utilizations and mean queue lengths without obtaining the queue length distribution [3, 14].)
(8)
For infinite server (IS) queues, Qtm>(n) = 1/at,,>. Reiser and Lavenberg also give an expression for Qt,">(n) for queues with a general CAP function; we will omit discussion of that general case because o f the similarity to the variable rate case in LBANC and because of the numerical difficulties to be discussed below in regard to queue length distributions. (At least part of the queue length distribution must be obtained to obtain Qtm>(n) for queues with general CAP functions.) By applying Little's rule to the mean cycle time (the mean time for a job to make a complete cycle around the network), we can get 575
N.
Z Lt,")(n) = n,
P(n) =
= 1. . . . .
(10)
G(n) - m - -
(12) n
Thus the mean queue lengths are immediately available once G is determined. Throughputs can be obtained from eq. (6) and mean queueing times from Little's rule. The queue length distribution is necessarily obtained for queue length dependent queues other than IS queues by LBANC; the queue length distribution is optionally obtained for fixed rate and IS queues. Utilizations can be obtained from throughputs for queues with fixed-rate servers (including IS queues) and from the queue length distribution for other queues. Applying Little's rule to eq. (8), L(m)(n) - R(,")(n_____~)(1 + L(,")(n) - 1)).
(13)
a(m)
Multiplying by G ( n ) and simplifying we obtain l(n) =
ut,")(G(n
-
1) +
l(,">(n -
1)).
(14)
From Qt,">(n) = 1/a+o for IS queues, we can similarly obtain I(,">(n) = u(,")G(n - 1).
(15)
For queues other than fixed rate single server and infinite server it can be shown from Lemma 1 of [15] that pt,")(i]n) = p t m ) ( i - 1 ] n - 1)U(m) f o r i > 0 , CAP(,")(0 Communications of the A C M
October 1980 Volume 23 N u m b e r 10
(16)
where p(m)(i1 n) is the unnormalized queue length distribution for queue m. After using eq. (16) we can then compute l(m)(n) f r o m
lt,o(n) = ~ ip(m)(i I n).
Fig. 1.
(17)
i=1
After having obtained G(n) we can compute
(18)
p(m)(Oln) = G(n) -- ~. p~m)(i[ n). i=l
LBANC is simply the application of these equations, l~m)(0) = 0 and p(m) (0 [ O) = 1. We will now give a more programlike definition o f LBANC. Let us assume that queues 1. . . . . I are single server fixed rate queues, that queues I + 1. . . . . J are IS q u e u e s a n d that q u e u e s J + 1. . . . .
M have general CAP
functions. We assume that we are primarily interested in metrics for population N and will reuse variables along the way, i.e., we will drop the n subscripts from all of the above variables, except G. G(0) = 1 F o r m = 1 to M
l~m~= 0 p(m)(0) = 1 F o r n = 1 to N {Iterate o v e r populations}
G(n) = 0 F o r m = 1 to I {Fixed rate queues} l~m) = u(m)(G(n - 1) + lo.)) G(n) = G(n) + l~m) F o r m = I + 1 to J {Infinite server queues} l(m) = u0
l(x, m)(nl, n2) =
(20)
0 i f nl = 0
l(~,m)(nl,n2) = {
u(2. m)(G(nl, n2 - 1) + l(m)(nl, n2 - 1)) if n2 > 0 0 if n2 = 0.
(21)
u(1, m)G(nl - 1, n2) if nl > 0 0 ifm = 0
(22)
For IS queues 1(1, m)(nl, n2) = and u(2,
1(2. m)(nl, 712) =
m)G(nl, n 2 -
0 if n2 = 0.
1) if n2 > 0
p(m)(0, 0lnl, n2)
G(nl, n2)
=
/7(m)(il, i21n1, n2).
-
(27)
il +i2#,0
After obtaining normalized m e a n queue lengths we determine R(1, m)(N1, N2) = r(a, m)
G ( N 1 - 1, N2)
G(N1, N2)
(28)
G ( N 1 , N2 - 1)
(29)
and R(2, m)(N1, N2) = r(2, m)
G(N1, N2)
where r(a, m) is the sum o f rc such that class c is in chain k and queue m. We can then obtain mean queueing times from Little's rule and utilizations from throughputs or the queue length distribution. Let us now consider a mixed network with one d o s e d chain and one open chain. Again, the restriction is for simplicity of notation; the argument extends to multiple closed and open chains. We assume all queues are either fLxed rate single server or infinite server, but the discussion extends to variable rate queues. We assume a single source with Poisson arrival rate R and consider the source and sinks to belong to class 0. That is, p0c is the probability an arriving job joins class c. r~ of eq. (2) should be increased by p0~. Let UCL(m) be the relative utilization of queue m by the closed chain classes and uoe(m) be the relative utilization of queue m by the open chain classes. For single server fLxed rate queues let the actual open chain utilization at queue m be UoP(m) "-~ RuoP(ra)
(23) and let the effective closed chain relative utilization at queue m be
For variable rate queues let p(m)(6, i2[nl, 712) be the unnormalized probability of il,/2 jobs at queue m given populations nl, n2. Let SHARE(m)(/) = CAP(m)(i)/i. SHARE(m)(/) is the fraction of the unit processing power available to each job in queue m when there a r e / j o b s in the queue. Then for variable rate queues, for 6 + / 2 > 0,
I f we were using the convolution algorithm, for fixed rate single server queues we would use
p(m)(il, i21n1, n2) =
)((=)(n) - (1 - UoP(m))"+1
Uov(.,) "
(24)
N
,~(m)(?1) -- U~L(m) n = 1. . . . . N. -" M COP(m)
n2
(25)
i1=1 /2=0
(Note that this is the inverse of the probability the open chain is empty.) N o w we can write eq. (14) as lcL(m)(n) = tiCL(m)(C-r(n-- 1) + lcL(m)(n -- 1))
and nl
n2
il~0 i2~1
(31)
~(o) = R(1)(o) . . . 2 ( ~ (o).
We can then determine
1(2, m)(nl, n~) = Y, Z i2p(m) ( ix, i2 t nl , n2 ).
(30)
We only need Xtm) (0) with LBANC. Let the normalizing constant with the closed chain empty be
0 if nl and n2 = 0.
Y, ilp(m)(il, i21n1, n2)
n = 1. . . . .
and for infinite server queues
i f i l , nl > 0
;(m)(il, i2 -- 11 nl, n2 - 1)u(2, m) if i2,712 > 0 i z S H A R E ( m ) ( i l + i2)
nl
I -
U~L(m)
)(m)(i!l- 1, i21 n l - 1, n2)u(1, m) i l S H A R E ( m ) ( i l + i2)
t(1, m>(nl, .5) = 2
UCL(ra) UCL(m) --
(32)
and eq. (15) as (26)
lcz(m)(n) ----UCL(m)(~(n -- 1).
After determining G we can use
As before, we get
577
Communications of the ACM
(33)
October 1980 Volume 23 Number 10
M E /CL(m) ( n )
G(n)
--
mffil
(34) n
PROOF. For the purpose of the proof we defme a function Ftm)(nl, n2) for each queue m as follows: For a fixed rate server
Closed chain throughput is obtained using G, i.e.,. O ( N - 1) RCL(m)(N) = rCL(m) G(N)
(rh + n2)! Ill! n2!
(35)
0
For the open chain, for the fixed rate queues, UoP(m)
1LOP(m)(N)
UoP(m)
=
lcz 0, n2 > 0 ---
Id(l'rn)U(2'rn)
V(m)(nl, n2) =
elsewhere
and for an infinite server
1)
ffCL(m)G(N)
U(1,m) if nl = 1, n2 = 0 u(2,m)if nl = 0, n2 ---- 1 0 elsewhere.
(36)
For the infinite server queues the closed chain has no effect on the open chain and we can use the standard formulas for an infinite server queue in isolation.
f
Ftm)(nl, n2) =
We shall now show by induction that N1,N2
3.4 The CCNC Algorithm The CCNC algorithm is principally intended for use with programmable calculators, though it certainly is not restricted to calculator implementations. It applies only to queues with fixed-rate servers or infinite servers; it can be used in conjunction with the convolution algorithm for networks containing queues with variable rates o f service. It takes advantage o f exponentiation and factorial operations usually provided as machine instructions and is trivial to implement to obtain normalizing constants. Other performance measures would typically be obtained by the unnormalized mean queue length expressions of LBANC (eqs. (14) and (15)) and other standard expressions, but on a queue by queue basis, since G has already been obtained. For notational convenience we restrict attention to the two closed chain case. The extension to more closed chains and mixed networks is straightforward. Note that C C N C does not apply to general variable rate queues, but only to fixed rate single server queues and infinite server queues. However, CCNC can be augmented by the convolution algorithm to handle general variable rate queues. For details and examples, see [20]. As before, let queues, 1. . . . . I correspond to fixedrate servers and let queues 1 4- 1. . . . . J be infinite server queues. Define CUM(nl, n2) as follows (CUM is an abbreviation for cumulative):
ltm)(N~, N~) =
I(~)(N1,
CUM(0, l)
= ~
N2)
= uo,,,oG(NI
- 1, S2)
NI--I,N 2
+
~
G(N1 -
+ u(2, m)G(N1, N2 +
~
G ( N 1 - nl, N2 -
=
NI--I
N2
~
~
G(N1 -
1 - nl, N2 - n2)u(l.m)F(m)(nh
n2)
nl=0 n2=0 N t N2--1
+
~
~
G ( N 1 - ni, N2 -
1 - n2)u(2, m)F(m)(nl,
n2)
nl~0 n2=,0 NI N2
=
E
E
G ( N 1 - nl, N2 - n2)uo, m)F(m)(nl
l, n2)
- -
nl=0 n2=0 NI N2
+
~
l)
Y. G ( N I - nl, 8 2 - n2)u(2,m)F~m)(ni, n2 -
nl--0 n2~0 NI N2
=
~
Y. G ( N 1 -- nl, N2 - n2)(u(1, m)F(m)(nl
- -
1, t13)
nl~0 n2m0
+ U(2, m ) F ( m ) ( n l , 712 - -
1))
NI, N2
~
G ( N x - nl, N2 - n2)F(m)(nl, n2)
(38)
Ut2, m )
nl! n2!
I mr1
U ni (1, m)U n2 (2, m)
for nl + n2 > 1.
The very last step follows from the fact that for (nl, n2) # (0,0) u(1, m ) F ( m ) ( n l
-
(39) THEOREM. For (Nb N2) # (0, 0) G(N1, N2) =
578
1 - n2)u(2,m)F(m)(nl, n2)
nl, n2#0, 0
nv n ~ 0 , 0
mr1
(nl,~),,(o,o)
1)
NI, N2-1
=
CUM(nx, n2) - ( h i 4- n2)!
N~,N2 2
n2)
1 - nl, N2 - n2)u(l,m)F(m)(nh
hi, n~O, 0
(37)
mffil d
G(N1 - n~, N~ - m)F~m)(nl, n~)
for fixed rate and infinite servers. This equation is obviously true for (N1, N2) = (0, 0), (0, 1) and (1, 0). Assume the equation is true for all (/(1, K2) such that either (1) K1 < N1 a n d / ( 2 -- N2 or (2) K1 -- N1 and/(2 < N2. W e shall now prove the equation for (K1,/(2) -- (N1, N2). For a fixed rate server, from eqs. (20) and (21) and applying the induction assumption,
d
CUM(I, 0) -- ~, U(1,m)
~ n l , n 2 ~ O, 0
G(N1 - nl, N2 - n2)CUM(nl, n2) N1 + N2
(40)
1, n2) +
u 0. 8 is an arbitrary constant near but less than 1, e.g., .99. E is chosen so that 1/¢ is near the limit of the floating point range of the computer being used (e.g., E = 10 -75 could be used for the 360/370 series.) Choose an arbitrary, algebraically valid {re}. Determine {uc} and {u(.0}. Let D -- l / m a x ( u ( , . . . . . u(t)). Repeat D - - 8D P--- (1 - Du(1)) . . . (1 - Du(I)) e -O(ua+l) . . . . . . Until P > • Forc= ltoC:rc=Drc Redetermine {uc) and {u