CS/ECE 75 Sprig 004 Homework 5 (Due date: March 6) Problem 0 (For fu). M/G/ Queue with Radom-Sized Batch Arrivals. Cosider the M/G/ system with the differece that customers are arrivig i batches accordig to a Poisso process with rate λ. Each batch has customers, where has a give distributio ad is idepedet of customer service times. Show that the waitig time i queue is give by λx X W ------------------- () ( ρ) + ----------------------- ( ρ) where X deotes service time. [Solutio] The waitig time of a customer, W, cosists of three parts, the residual service time of the customer beig served R, the average service time of all customers waitig i queue ρw, ad the average waitig time of the customer for other customers who arrived i the same batch. where the mea residual service time is W R + ρw + W B () λx R ------------ (3) We derive the average waitig time of a customer for other customers that arrived i the same batch where W B j r j E{ W B batch has size j} (4) P j Probability a batch has size j (5) r j Proportio of customers arrivig i a batch of size j (6) We have Also sice the customer is equally likely to be i ay positio withi the batch Thus r j jp -------------------- j P jp ------ j j E{ W B batch is of size j} ( k )X -- j --------- X j k (7) (8)
E{ W B } Substitutig i () we obtai (). Problem. I the M/G/ system show that jp j ( j )X -------------------------- j X ( ) ---------------------- (9) P( the system is empty) λx Average legth of time betwee busy periods -- λ X Average legth of busy period --------------- λx Average umber of customers served i a busy period --------------- λx where X is average service time. [Solutio] From Little's Theorem we have that P{ busy} λx. Therefore P{ idle} λx. The legth of a idle period is the remaiig iterarrival time. Therefore it has a expoetial distributio with parameter λ. Let B be the average legth of a busy period ad let I be the average legth of a idle period. By expressig the proportio of time the system is busy as B/(I+B) ad also as B X ( λx). From this the expressio period is evidet. ( λx) we obtai for the average umber of customers served i a busy λx Problem. Cosider a computer system with a CPU ad oe disk drive. After a burst at the CPU the job completes executio with probability 0. ad request a disk I/O with probability 0.9. The time of a sigle CPU burst is expoetially distributed with mea 0.0 s. The disk service time is broke up ito three phases: expoetially distributed seek time with mea 0.03 s, uiformly distributed latecy time with mea 0.0 s, ad a costat trasfer time equal to 0.0 s. After a service completio at the disk, the job always requires a CPU burst. The average arrival rate of jobs is 0.8 job/s ad the system does ot have eough mai memory to support multiprogrammig. Solve for the average respose time. I order to computer the mea ad the variace of the service time distributio, you may eed the followig results o radom sums. [Radom Sums] We have cosidered sums of N mutually idepedet radom variable whe N is a fixed costat. Here we are iterested i the case whe N itself is radom variable that is idepedet of
X k. Give a list X, X,, of mutually i.i.d. radom variables with distributio fuctio Fx ( ), mea EX [ ] ad variace Var[ X], cosider the radom sum T X + X + + X N. Here the pmf of the discrete radom variable p N ( ) is assumed to be give. For a fixed value N, the coditioal expectatio of T is easily obtaied ETN [ ] EX [ i ] The, usig the theorem of total expectatio, we get i E[ X] (0) Similarly, we have ET [ ] E[ X]p N ( ) EX [ ] p N ( ) EX [ ]EN [ ] () Var[ T] ET [ ] ( ET [ ]) E{ E[ T N ] } ( ET [ ]) () E{ Var[ X] + ( EX [ ]) } ( ET [ ]) Var[ X]EN [ ] + ( EX [ ]) Var[ N] [Solutio] From the give parameters, we have: λ 0.8, mea time of a CPU burst ET [ c ] 0.0, mea disk seek time ET [ s ] 0.03, mea disk latecy time ET [ l ] 0.0, ad mea trasfer time ET [ t ] 0.0. Besides, the job requests a disk with probability p 0.9. Sice ad are expoetially distributed, T c T s ET [ s ] ( ET [ s ]) 8 0 4 [ ] ( ET [ c ]) 0 4 Sice is uiformly distributed i iterval (0,0.0), T l ET c (3) 0.0 3 4 ET [ l ] ------------------- -- 0 4 (4) 3 0.0 3 Sice T t is a costat time, ET [ t ] 0 4, the, the disk service time T d T s + T l + T t, we get ET [ d ] ET [ s ] + ET [ l ] + ET [ t ] 0.05 (5) ET [ d ] E[ ( T s + T l + T t ) ] 3.433 0 3 (6) From the descriptio of the problem, the total service time T is it c + ( i )T d with probability p ( i ) ( p), i,,,. Thus ET [ ] p ( i ) ( p) [ ie[ T c ] + ( i )ET [ d ]] i ET [ c ] ------------- ip i 9 + 0. ET [ d ] ip i 0 ET [ c ] + 9 ET [ d ] 0.55 3 (7)
ET [ ] p ( i ) ( p)et [ () i ] i p ( i ) ( p) ie[ T c ] ii ( )ET [ c ]ET [ d ] ( i ) ( + + ET [ d ]) i -- ( ET [ 9 c ] ET [ c ]ET [ d ]) ip i + --E[ T 9 c ]ET [ d ] + 0. ET [ d ] i p i i i (8) time 0679 Variace: Var[ T] ET [ ] ( ET [ ]) 0.3765. So, ρ λet [ ] 0.44, the average respose ER [ ] ca be obtaied: EN [ ] λe[ T ] ER [ ] ------------ ET [ ] + -------------------.305 (9) λ ( ρ) Problem 3. Persos arrive at a Xerox machie accordig to a Poisso process with rate oe per miute. The umber of copies to be made by each perso is uiformly distributed betwee ad 0. Each copy requires 3 sec. Fid the average waitig time i queue whe: [Solutio] (a) Each perso uses the machie o a first-come first-serve basis. (b) Persos with o more tha copies to make are give preemptive priority over other persos. (a) λ 60 per secod EX ( ) 6.5 secods EX ( ) 346.5 secods T E( X) + λex ( ) [ ( λe( X) )] 0.48 secods. W T E( X) 3.98 secods (b) Preemptive Queueig λ -----, λ, 60 -------- λ 300 ----- 75 EX ( ).5, EX ( ) 47.5 λ R ----- EX ( ) 0.0375 4
R R + --λ EX ( ).8875 EX ( T )( ρ ) + R EX ( ----------------------------------------------- 4.538, T )( ρ ρ ) + R ρ ----------------------------------------------------------- ( ρ )( ρ ρ ) 3.84 W T EX ( ) 0.038, W T EX ( ) 4.34 (Assume a customer with lower priority is put back ito the queue oce the service is preempted by a customer with higher priority.) Problem 4. Priority Systems with Multiple Servers. Cosider the priority systems assumig that there are m servers ad that all priority classes have expoetially distributed service times with commo mea µ. (a) Cosider the opreemptive system. Show that the average queueig time is give by R W k ---------------------------------------------------------------------------------------------- ( ρ ρ k )( ρ ρ k ) with R, the mea residual time, is give by (0) where P Q P R ------- Q () mµ is the steady-state probability of queueig give by the Erlag C formula. [Here ρ i λ i ( mµ ) ad ρ ρ i.] i (b) Cosider the preemptive resume system. Argue that W ( k), defied as the average time i queue averaged over the first k priority classes, is the same as for a M/M/m system with arrival rate λ + λ + + λ k ad mea service time µ. Use Little s Theorem to show that the average time i queue of a k th priority class customer ca be obtaied recursively from W W ( ) k k W k ---- W, (3) λ ( k) λ i k W ( k ) λ i k 3,,, i i [Erlag C formula] () 5
I a M/M/m system, the probability that a arrival will fid all servers busy is [Solutio] (a) The same derivatio as i the otes applies for, i.e., W k R ( ρ ρ k )( ρ ρ k ) (6) where ρ i λ i ( mµ ), ad R is the mea residual service time. Thik of the system as beig comprised of a servig sectio ad a waitig sectio. The residual service time is just the time util ay of the customers i the waitig sectio ca eter the servig sectio. Thus, the residual service time of a customer is zero if the customer eters service immediately because there is a free server at the time of arrival, ad is otherwise equal to the time betwee the customer s arrival, ad the first subsequet service completio. Usig the memoryless property of the expoetial distributio it is see that p P Q P{ Queueig} 0 ( mρ) m -----------------------, where p is (4) m! ( ρ) 0 R P Q E{ Residual service time queueig occurs} P Q ( mµ ) (7) (b) The waitig time of classes,, k is ot iflueced by the presece of classes (k+),...,. All priority classes have the same service time distributio, thus, iterchagig the order of service does ot chage the average waitig time,. We have p 0 m ( mρ) -------------- ( mρ) m! + ----------------------- m! ( ρ) 0 W k (5) W ( k) Average waitig time for the M/M/m system with rate ( λ + + λ k ) By Little s theorem we have Average umber i queue of class k Average umber i queue of classes to k Average umber i queue of classes to k- ad the desired result follows. (8) (9) 6