M/M/ and M/M/m Queueing Systems M. Veeraraghavan; March 20, 2004. Preliminaries. Kendall s notation: G/G/n/k queue G: General - can be any distribution. First letter: Arrival process; M: memoryless - exponential interarrival times - Poisson arrival process Second letter: Service times distribution - M: exponential, D - Deterministic Third letter: Number of servers, n Fourth letter: Number in system (including number in queue and number being served) Important: In all cases, service times s n are mutually independent of each other, and are also independent of interarrival times. Successive interarrival times are iid with the distribution specified by the first letter. Successive service times are also iid with the distribution specified by the second letter. This means the arrival process and departure process are both renewal processes - iid random sequence..2 Relation between M/M/ queue and MC Why can the process Nt (), the number of customers in the system at time t in an M/M/ queue, be modeled as a Markov chain? Answer: [4, pg. 26] Given that the memoryless property PLUS the independence assumption of interarrival and service times, the number of customers in the system at a future time t + h only depends upon the number in the system now (at time t ) and the arrivals or departures that occur within the interval h. Past history of how the system got to its state at time t is irrelevant. Additional time needed to complete service of customer being served observes the memoryless property. Nt ( + h) Nt () + Xh ( ) Yh ( ), () where Xh ( ) is the number of arrivals in the time interval ( t, t+ h), and Yh ( ) is the number of departures in the time interval ( t, t+ h). Xh ( ) is dependent only on h because the arrival process
is Poisson. Yh ( ) is 0 if the service time of the customer being served, s > h. Yh ( ) is, if s h and s 2 + s > h, and so on. As the service times s, s 2,, s n are independent, neither Xh ( ) nor Yh ( ) depend on what happened prior to t. Thus, N( t+ h) only depends upon Nt () and not the past history. Hence it is a CTMC. 2. Analysis of the M/M/ queue using CTMC results: [3], page 365-37. First consider a special case of an irreducible time-homogeneous MC, i.e., a birth-death process. A homogeneous CTMC is a birth-death process if there exists constants i, i 0,,, and µ i, i 0,, such that the transition rates are given by: q i i+, i, q ii, µ i, q i i + µ i and q ij 0 for i j >. (2) The reason q i i + µ i is as follows: See () in Markov Chain lecture, which states that p jj ( tt, + h) q j () t h + o( h), which for a homogeneous MC can be rewritten as (3) p jj ( h) q j h + o( h) Remembering that the sum of all transition probabilities out of a state is, p jj ( tt, + h) (4) should be equal to p ji ( tt, + h). This is equal to ( i + µ i )h + oh ( ). Therefore q j i + µ i. i Use the global balance equations derived for steady-state solution of an irreducible, homogeneous CTMC (eqn 32 of MC.pdf): k j p k q kj q j p j 0 (5) combined with the equation p j, where p j is the steady-state limiting probability of the j system being in state j and q kj and q j are the transition rates. Applying this to our birth-death MC, we get ( j + µ j )p j p j + µ j + p j j + + 0 0 + µ p 0 (6) (7)
Eqn. (7) is the same as the detailed balance equation we showed for a birth-death DTMC in MC.pdf. See Fig. for a birth-death CTMC. Note the difference between the state diagram of a CTMC and the state diagram of a DTMC. In the latter the arcs are labeled with conditional probabilities; in the former they are labeled with transition rates - so the latter is sometime called transition-rate diagram - this from [3], page 367. 0 0 2 2 n n... n n+... µ µ 2 µ 3 µ n µ n + Figure :CTMC for a birth-death process; interesting that we don t show the self-loops Rearranging (6), we get: Similarly, and so on until: j p j µ j + p j + j j p j µ j p j j 2 p j µ j p j p j 2 µ j p j (8) (9) p µ 2 p 2 0 µ p. (0) Therefore: j p j µ j + p j + j p j µ j p j j 2 p j 2 µ j p p µ j 0 () From (7), since 0 µ p 0, Therefore: Since p j : j j j p j µ j p j 0 and hence p j pj for (2) j j µ j j j 2 0 p j - for (3) µ j µ j µ p p - i j 0 0 0 µ i + i 0
-. (4) The number of customers in an M/M/ queue is a homogeneous, irreducible birth-death CTMC in which for i and µ i µ for i. Applying (3) and (4) to this case yields: i p j and, if. (5) µ j p p 0 0 < + µ j µ j µ µ We define traffic intensity, µ. < for a stable system. Server utilization U. + j j i 0 The mean number of customers in the system in the steady-state can be computed: j i - µ i + j 0 EN [ ] np n n n ( ) ( ) n n n 0 n 0 n 0 (6) n EN [ ] ( ) ( ) n n 0 n 0 ( ) ( ) (7) EN [ ] ( ) ( ) 2 ( ) (8) Derive Var[ N] (9) ( ) 2 Mean response time (using Little s Law): Mean waiting time in queue: ET [ ] EN [ ] ( ) - µ (20) EW [ ] ET [ ] - µ µ µ Mean number of customers in queue (again using Little s Law): - µ (2) EN [ Q ] EW [ ] ; also EN [ (22) ( ) Q ] EN [ ] ( ) ( ) 2 2
Subtract and not because is the probability that the server is busy. Above results hold for disciplines other than FCFS. It holds for any scheduling discipline as long as [3], page 370):. The server is not idle when there are jobs waiting for service (work conserving) 2. The scheduler is not allowed to use any deterministic a priori information about job service times (e.g., Shortest Remaining Processing Time First - SPRT will reduce E[R]). 3. The service time distribution is not affected by the scheduling discipline. 3. Derivation of M/M/ queue results using DTMC Both [4] and [5] analyze the M/M/ queue using a DTMC. Focus attention on the time instants: 0, δ, 2δ, 3δ,, where δ is a small positive number. Let N k be the number of customers in the system at time kδ. The process { N k k 0,, } is a DTMC with the same steady-state occupancy distribution as those of the CTMC Nt (). The DTMC for an M/M/ queue is shown in Fig. δ δ µδ δ µδ δ µδ δ µδ δ δ δ δ δ... n n+... µδ µδ µδ µδ µδ Figure 2:DTMC for an MM/ queue; transition probabilities are correct up to an o( δ) term 2. It is a birth-death DTMC. The transition probabilities P ij P{ N k + j N k i} is independent of k for a time-homogeneous DTMC. P 00 δ + o( δ) e δ (Poisson arrival process) (23) P ii δ µδ + o( δ) e δ e µδ for i, (24) which is the prob. of 0 arrivals and 0 departures in interval ( kδ, ( k + )δ)., δ + o( δ) e µδ δe δ for i 0, (25) P i i+ which is the prob. of arrival and 0 departures in interval ( kδ, ( k + )δ), µδ + o( δ) e δ µδe µδ for i, (26) P i i which is the prob. of 0 arrivals and departure in interval ( kδ, ( k + )δ)
P ij o( δ) for i j > (27) Neglect all terms in the second order of δ. With this DTMC, we can find the stationary distribution (steady-state) using the derivation in MC.pdf for time-homogeneous irreducible DTMCs: ν n lim P{ N k n} k lim P{ N() t n} t Using the detailed balance equations (see the lecture MC.pdf) - since it is a birth-death process: (28) ν n p nn+ n 0,, ( ) ν n + p ( n + )n Applying it to the DTMC of the M/M/ queue shown in Fig. 2: p n δ + o( δ) p n + µδ + o( δ) (29) (30) As δ 0, Setting µ 4. Distribution of response time + p n for (3) µ n 02,,, p n, we get the same results as with the CTMC derivation. This DOES depend upon the scheduling discipline (unlike the average response time). We derive the response time distribution assuming the FCFS (First Come First Serve) scheduling discipline. Let the arriving job find n jobs in the system. Response time R S+ S' + S 2 + + S n, where S is the service time of the arriving job, S' is the remaining time of the job in service and S i, i 2,, n are the service times of the ( n ) jobs in the queue. These are n independent random variables. Given the memoryless property of the exponential distribution, we can write the Laplace transform of the conditional distribution of R given N n as L RN ( sn) - µ n + s + µ (32) Laplace transform of a nonnegative continuous random variable X is defined as [3], page 96: L X ( s) Ls ( ) M X ( s) e sx fx ( ) dx 0 (33) If X is a nonnegative integer-valued discrete random variable, then we define its z-transform as:
G X ( z) Gz ( ) Ez [ X ] M X ( lnz) p X ()z i i, (34) i 0 where moment generating function M X ( θ) is given by (if X is a r.v., Xθ is also a r.v.): M X ( θ) Ee [ Xθ ] (35) The convolution theorem: Let X, X 2,, X n be mutually independent random variables and let Y n X i. Then if M Xi ( θ) exists for all i, then: i M Y ( θ) M X ( θ)m X2 ( θ) M Xn ( θ), (36) i.e., the moment generating function of a sum of independent random variables is the product of the moment generating functions. Proof: ( M Y ( θ) Ee X + X 2 + + X n )θ [ ] E e X iθ n i n i Ee X iθ [ ] by independence (37) n Hence M Y ( θ) M Xi ( θ) (38) i Sum of mutually exclusive events PA ( B) PA ( ) + PB ( ) and product of independent random variables PX ( X 2 ) PX ( )PX ( 2 ). So for a sum of independent random variables, we use the theorem that the product of moment generating functions of the r.vs. is the moment generating function of the sum. Going back to (32), and applying the theorem of total Laplace transform (like the theorem of total probability), and using (5) for p n, we get: L R ( s) n 0 - µ n + ( ) n s + µ (39)
L R ( s) µ ( ) s + µ - µ µ ( ) s + µ µ s + µ µ ( ) s + µ ( ) (40) This means R is exponentially distributed with parameter µ ( ). Laplace transform for an exponentially distributed random variable X is: L X ( s) e sx e x dx 0 - s + (4) 5. M/M/m queue The underlying Markov chain is again a birth-death process with k for k 02,,, and (42) kµ 0 < k< m µ k mµ k m (43) Plugging these into (3) yields: k p k p 0 p for, and (44) ( i + )µ 0 µ k - k< m k! m i 0 k p k - for. (45) ( i + )µ p mµ 0 µ k m!m k m k m i 0 j m Here is the interesting thing regarding traffic intensity. We called traffic intensity in the M/M/ queue derivation as it is called in [3], page 368. In [6], page 824, is called traffic load. In an M/M/ queue, the utilization ( ) (i.e., probability that the server is not idle) turns out to be equal to. For an M/M/m queue, the condition for stability is - <. Traffic load should not be mµ dependent on m. But here both [3] and [4] set ( mµ ). NOTE THIS REDEFINITION OF (confusing to redefine but it helps the analytics).
Using (45) and p k, we derive as: k 0 m k 0 ( m) k + k! k m ( m) k m!m k m (46) m ( m) k ( m) m + k! - m! k m k 0 k m m k 0 ( m) k ( m) m + k! - m! i i 0 (47) m k 0 ( m) k ( m) m - + k! m! ( ) (48) EN [ ] kp k m + - ( m)m m! ( ) 2 k 0 (Exercise: derive this) (49) If M is an r.v. denoting the number of busy servers, then: m EM [ ] kp k + m p k kp k + m ( m) k m!m k m k 0 m k m m k 0 k m m EM [ ] kp k - ( m) m - mp + kp m m! k + - k 0 m k 0 (50) (5) where p m ( m) m - (52) m! Exercise: Show that EM [ ] m µ. Therefore the utilization of any individual server is ( EM [ ]) m, while the average number of busy servers is equal to traffic intensity µ. I d define utilization of the system to be EM [ ] and hence equal to the traffic intensity (same as in M/M/ queue). See [7], page 492: is called per-server utilization and m is called total traffic intensity. Unit of µ is defined in [7], page 492 as measured in the Erlangs. µ is also referred to as total load on the system. Same as in [6].
Probability of an arriving job finding that all m is given by: servers are busy is called Erlang-C formula and Pqueueing [ ] p k k m p m - (see (5) and (52)) (53) P Q P[ queueing] ( m) m - - p0 (54) m! The above is a call queueing system in a telephone network with an infinite buffer. It s also called Erlang s delayed-call formula. Average number in queue (not in service) is: EN [ Q ] ( k m )p ( k m)p k 0 ( m) k m!m k m k m+ k m+ (55) ( m) m EN [ Q ] - ( k m) k m m! k m+ ( m) m p - 0 m! n n n 0 (56) Using (54) and ( ) n n n 0 -, we can express the mean number waiting in queue as Using Little s Law, EN [ Q ] P Q ( ) ( ) 2 P Q ( ) (57) EW [ ] P Q ( ) and (58) Using ( mµ ), we get ET [ ] EW [ ] + µ µ P Q + mµ (59) Using Little s Law, EN [ ] P Q µ + mµ P m + - Q, which is the same as (49). (60)
Compare M/M/ queue with a fast server operating at mµ with an M/M/m system: Average packet delay (mean response time) in the M/M/m system is: ET [ ] µ P Q + mµ (6) Average packet delay in an M/M/ queue with service rate mµ is: In an M/M/ queue ETˆ [ ] mµ - mµ P ˆ + Q mµ (62) P ˆ Q ( m) m p - 0 - because p. (63) m! 0 ET [ ] - mµ mµ + mµ ( mµ ) + mµ - mµ ( mµ ) Under light loads «, P Q P ˆ Q 0 then ET - [ ] m ETˆ [ ] Under heavy loads, ˆ and µ «( mµ ), then P Q P Q -. (64) ( mµ ) (65) ET [ ] - (66) ETˆ [ ] The above is a comparison of statistical multiplexing (where whole link capacity can be used) and TDM/FDM schemes where once a circuit capacity is assigned, it is not increased during the lifetime of the call. 6. M/M/ Suppose PXt ( () n) is the probability that n telephone lines are busy at time t. Assume that infinitely many lines are available and that the call arrival rate is while average call duration is µ. Find P( Xt () n) as t. Let ENt [ ()] denote the average number of busy lines at time t. Find the value of E[ Nt ()] time for this queueing system in the steady state. This is a M/M/ queueing system. when the system reaches steady state. Also find the average response
0 n µ 2µ nµ ( n + )µ State transition diagram As t, we have PX ( n) PX ( n ) nµ µ npx - ( 0 ) n! (67) Thus, PX ( 0) - e µ µ n! n 0 e (68) Since there are always enough telephone lines for any call, the response time follows exponential distribution with the average value of µ. EN [ ] np ( X n ) µ n References [] K. S. Trivedi, Probability, Statistics with Reliability, Queueing and Computer Science Applications, Second Edition, Wiley, 2002, ISBN 0-47-3334-7. [2] R. Yates and D. Goodman, Probability and Stochastic Processes, Wiley, ISBN 0-47-7837-3. [3] K. S. Trivedi, Probability, Statistics with Reliability, Queueing and Computer Science Applications, First Edition, Prentice Hall, 982, ISBN 0-3-7564-4r. [4] D. Bertsekas and R. Gallager, Data Networks, Prentice Hall, 986, ISBN 0-3-96825-4. [5] Prof. Boorstyn s notes, Polytechnic University, NY. [6] A. Leon Garcia and I. Widjaja, Communication Networks, McGraw Hill, 2000, First Edition. [7] Mischa Schwartz, Telecommunications Networks, Protocols, Modeling and Analysis, Addison Wesley, 987. (69)