B. Maddah ENMG 6 ENMG 5 5//9 Queueig Theory () Distributio of waitig time i M/M/ Let T q be the waitig time i queue of a ustomer. The it a be show that, ( ) t { q > } =. T t e Let T be the total time of a ustomer i the system (i queue plus i servie). The, it a be show i a similar way that T t e ( ) t { > } =. Example I the bak of Example, what is the probability that the waitig time of a ustomer exeeds hours? {T q > t} = e ()t =.9e =.. What is the probability that a ustomer speds more tha 3 hours i the bak? {T > t} = e ()t = e 3 =.5. Example 3 Cosider a Iterfae Message roessor (IM). The paket size i bits is expoetially distributed with mea / bits/paket. The apaity of the ommuiatio hael is C bits/se. akets arrive at radom (i.e. expoetial iter
arrival times) with arrival rate pakets/se. Fid the queueig delay for pakets at the IM. Model this as a M/M/ with arrival rate pakets/se ad servie rate C/(/) = C pakets/se. The, the mea delay per paket is W q = /( C ). Example 4 (Dediated vs. shared haels). Two omputers are oeted by a 64 kbps lie. There are eight parallel sessios usig the lie. Eah sessio geerates oisso traffi with a mea of pakets/se. The paket legths are expoetially distributed with mea of bits. The system desigers must hoose betwee givig eah sessio a dediated 8 kbps piee of badwidth or havig all pakets ompete for a sigle 64 kbps shared hael. Whih alterative gives better respose time (i.e. W)? We eed to ompare two alterative M/M/ models. The first model has four haels eah operatig as a M/M/ with = pakets/se ad = 8/ = 4 pakets/se. Therefore, W = / ( ) = / =.5 se. The seod model has oe hael with = 8 = 6 pakets/se, ad = 64/ = 3 pakets/se. Therefore, W = / ( ) =/6 =.63 se.
The respose time i the shared system is 8 times less. This is the better alterative. (Note that both systems have the same =.5.) Why this result? I the dediated system, some haels ould be idle, while other haels have log queues. This does ot happe i the shared system. The M/M/ queue This is a queue with a oisso arrival proess with rate, expoetial servie times with rate ad servers. It is a geeralizatio of M/M/ with multi-servers. : The umber of ustomers i the M/M/ system L(t) is a birth death proess with =, ad, if < = if The expressio for follows sie the miimum of expoetial rvs with rate is expoetial with rate. 3
The trasitio diagram for = is show below. 3 Reall that = /() is the traffi itesity. Defie a = /. This is the mea umber of busy servers. I the followig we assume <. Applyig the geeral flow balae equatio for a birth-death proess, the limitig probabilities are give by = + = m= = + + =! =! a a = + =! =! a a a = + =!! = a a = + =!! K K m a a = + =!!( ) 4
The, a, if <! = a if! The, the mea umber i queue is a a L q = ( ) = ( ) = ( ) = =!! = a a!!( ) m = m = m= m sie m = ( ) m= The, Little s law implies that the mea waitig time is Lq a a Wq = = =!( )!( )( ) I additio, the mea umber i the system is a L = Lq + a = a +!( ) Ad the mea time i the system, is a W = Wq + = +!( )( ) The probability that all servers are busy is a a + = = = =!!( ) = = a 5
Let T q be the waitig time i queue of a ustomer. The, a!( ) ( ) t { Tq > t} = e This a be show similar to the M/M/ ase. Example 5 (ehaed bak servie) I the M/M/ bak model with = 9 ustomers/hour ad = ustomers/hour. We fid that the mea waitig time is W q = 54 mis. Maagemet is osiderig addig more servers to brig the mea waitig time to less tha 5 miutes. How may more servers should be added? Try addig aother server. For this M/M/ system, a =.9 ad = a/ =.45. The, W q a a.9 = + = +.9 + =.379!!( )!(.45) = a.9 = =!( )( )!( )(.45).379 =.5 hours =.5 mis Addig oe more server ahieves the desired servie level. 6
Example 6. A airlie is plaig a ew telephoe reservatio eter. Eah aget will have a reservatios termial ad a serve a typial aller i 5 miutes, the servie time beig expoetially distributed. Calls arrive radomly ad the system has a large message bufferig system to hold alls that arrive whe o aget is free. A average of 36 alls per hour is expeted durig the peak period of the day. The desig riterio for the ew faility is that the probability a aller will fid all agets busy must ot exeed. (%). How may termials should be provided? This a be modeled as a M/M/ with = 36 alls /hour, = 6/5 = alls /hour, ad is to be determied suh that + <.. The miimum umber of termials,, eeded is oe that ahieves stability. That is, = /()< 36 /()< > 3. Try = 4, the = 36/48 =.75 ad a = 4 = 3. + 3 4 a a 3 3 3 = + = + 3 + + +!!( ) 6 4!(.75) = =.37736 4 a 3 = =.37736 =.59!( ) 4!(.75) So, four termials wo t do it. 7
Try = 5. Repeatig the same omputatios yields + =.3. Try = 6. Repeatig the same omputatios yields + =.99. So, six termials are eeded to ahieve the desired servie level. The M/M//K queue This is a sigle-server queue with oisso arrivals at rate, ad expoetial servie times with rate. However, the system a aommodate at most K ustomers (i.e., there are oly K waitig spaes). K is kow as the buffer size. E.g., o A bak that has room for at most K ustomers. o A maufaturig statio with a WI buffer of apaity K. o A all eter that a hadle at most K alls. Arrivig ustomers who fid the system full leave immediately (these are lost ustomers). ( K ) K K... 3 The umber of ustomers i the M/M//K system L(t) is a birth death proess with states,,,,,k, =, ad 8
, if = if < K K The trasitio diagram for K = 3 is show below. 3 Defie = /. Note that eeds ot to be less tha here. (why?) Applyig the geeral flow balae equatio for a birth-death proess, the limitig probabilities are give by K K K K = + = = = = K, = where K K + = ( ) /( ) if, ad = K = K + if =. = The, 9
Ad, for =,,, K, if K + =, if = K + ( ), if K + =, if = K + The probability that a ustomer is lost is K. The effetive arrival rate e is the rate of arrivals who joi the system. The, = ( ). The fratio of time the server is busy is e /. If, the mea umber i the system is e K L K ( ) ( ) = = ( ) ( ) K + K + = = K + ( K + ) = K +, K sie K = = ( ) K + K + ( ) ( K + ). If =,
K K K( K + ) K L = = = = K + ( K + ) = =. Little s law implies that the mea waitig time is W = L The mea umber i queue is e Lq = L. The mea waitig time is e W q = Lq. e Fat. e = ( K ) = ( ). Example 7 Seas Begiigs, a small mail order firm, has oe phoe operator. Calls arrive to Seas Begiigs at a oisso rate of 6 per hour, ad it takes a expoetially distributed time with mea miute to hadle a all. Whe the operator is busy, a iomig all is put o hold (with ie musi) i oe of K phoe lies Seas Begiigs. If all K lies are busy (meaig that oe all is beig hadled ad K are o hold), a aller gets a busy sigal ad alls a ompetitor (Air Ed). Seas Begiigs wats at most % of aller to
get a busy sigal. How may phoe lies should be provided? This a be modeled as a M/M//K with = = 6 / hour. The, =, ad K = / (K+). The desired servie level requires K. K+ > K =. What about mea aller delay? W q = (L e /)/ e = [Κ / /(K+)]/{[ /(K+)]} =.84 hours 5 miutes. (too log). How a this system be improved? Add more operators to brig mea delay dow while maitaiig a rejetio probability of %. Geeralize M/M//K to multi-server.