Queuig Theory Basic properties, Markovia models, Networks of queues, Geeral service time distributios, Fiite source models, Multiserver queues Chapter 8
Kedall s Notatio for Queuig Systems A/B/X/Y/Z: A = iterarrival time distributio B = service time distributio G = geeral (i.e., ot specified); M = Markovia (expoetial); D = determiistic X = umber of parallel service chaels Y = limit o system pop. (i queue + i service); default is Z = queue disciplie; default is FCFS (first come first served) Others are LCFS, radom, priority Chapter 8 2
Radom variables: Other Notatio X(t) = Number of customers i the system at time t S = Service time of a arbitrary customer W* = Amout of time a arbitrary customer speds i the system W Q * = Amout of time a arbitrary customer speds waitig for service Ofte we are most iterested i the averages or expectatios: S ( ) L= E X t LQ = Average umber i the queue L = Average umber i service Q [ *] W = E W W = E WQ* Chapter 8 3
Little s Formula w * is the time spet i the system by the th customer. Assume these k system times are uiformly fiite ad let w= lim k k w * = be the customer average time spet i the system. s Also, let X = lim s s X( t) dt 0 be the time average umber of jobs i the system. The uder very geeral coditios, X = λaw where λ a is the arrival rate. This is usually writte L = λ a W. The mea umber of customers i the system is proportioal to the mea time i the system! Chapter 8 4
Heuristic Proof of Little s Formula B(t) = cum. area betwee curves A(t) D(t) Two ways to compute BT ( ) = w * = X( tdt ) = 0 Mea time i system i (0,T): = = Mea umber i system i (0,T): XT ( ) = BT ( ) T The N T Chapter 8 5 T WT ( ) BT ( ) N BT ( ) AT ( ) BT ( ) AT ( ) lim X ( T) = lim = lim λ ( T) W( T), or L= λaw T T AT ( ) T T
Other Little s Formulae I queue: LQ = λawq I service: L = λ E S S [ ] ad their implicatios a [ ] Expected umber of busy servers LS = λae S ρ Expected umber of idle servers # servers ρ Sigle server utilizatio LS = λae[ S] = ρ Sigle server prob. of empty system ρ Chapter 8 6
Observatio Times { } P = lim t P X( t) =, = 0,,... a = Proportio of arrivig customers that fid i the system d = Proportio of departig customers that leave behid i the system If customers arrive oe at a time ad are served oe at a time the a = d But these proportios may ot match the limitig probability of havig i the system (log ru proportio of time that are i the system) However, if arrivals follow a Poisso process the a = P This is kow as PASTA (Poisso Arrivals See Time Averages) Chapter 8 7
M/M/ Model Sigle server, Poisso arrivals (rate λ), expoetial service times (rate µ) CTMC (birth-death) model: Chapter 8 8
M/M/ Steady-State Probabilities Level-crossig equatios: Solve for P i terms of P 0 { } P = lim P X( t) =, = 0,,... t λ P = µ P +, = 0,, P ( λ ) µ P0,,2, = = The use the facts that P 0 =, r = ( r) if r < = = 0 ad substitute ρ = λ / µ to get = ρ ( ρ), = 0,, if ρ < P Chapter 8 9
M/M/ Performace Measures Steady-state expected umber of customers i the system Mea time i system Mea time i queue Mea umber i queue ρ L= P, if 0 = ρ < = ρ W L = = = by Little's Formula λ µ ( ρ ) µ λ a W L Q Q = W = λw Q λ = µ µ µ -λ = 2 λ µ µλ ( ) ( - ) Chapter 8 0
M/M/ Performace Measures Distributio of time i system (FCFS) PW [ * x] = a PW [ * x arrival sees customers] = 0 = 0 = ( ρρ ) PW [ * x W* gamma( +, µ )] µ x l µ ( ρ) x ( ρρ ) e ( µ x) l! e, x 0 = 0 l= + = = Expoetial with parameter µ(-ρ) Reversibility: Departure process is Poisso with rate λ Chapter 8
Fiite Capacity: M/M//N Model Sigle server, expoetial service times (rate µ) Poisso arrivals (rate λ) as log as there are N i the system CTMC (birth-death) model: Chapter 8 2
M/M//N Steady-State Probabilities { } P = lim P X( t) =, = 0,,... t Level-crossig equatios: λ P = µ P +, = 0,,, N Solve for P i terms of P 0 The use the facts that N + N r P, (ote: eed ot be < ) 0 = r r = = = 0 r to get ( λµ ) ( λµ ) N ( λµ ) + P =, = 0,,, N Chapter 8 3
M/M//N Performace Measures (I the ulikely evet that λ = µ, for =,, N, ( ) P = P0 = N + ) Steady-state expected umber of customers i the system, L, has a messy closed form L Mea time i system W = by Little's Formula λ but here, λ a is the rate of arrival ito the system WQ W µ a = = λ ( ) L P W Q N Q λ a ( P ) = λ N Chapter 8 4
Tadem Queue λ µ µ 2 If arrivals to the first server follow a Poisso process ad service times are expoetial, the arrivals to the secod server also follow a Poisso process ad the two queues behave as idepedet M/M/ systems: P{ customers at server ad m customers at server 2} = λ λ λ λ µ µ µ µ 2 2 m Chapter 8 5
Ope Network of Queues k servers, customers arrive at server k from outside the system accordig to a Poisso process with rate r k, idepedet of the other servers Upo completig service at server i, customer goes to server j with probability P ij, where P j ij k For j =,, k, the total arrival rate to server j is λ r i= The umber of customers at each server is idepedet ad λ j If λ j < µ j for all j, the P{ customers at server j} that is, each acts like a idepedet M/M/ queue! = + λ P j j i ij λ j = µ j µ j Chapter 8 6
Closed Queuig Network m customers move amog k servers Upo completig service at server i, customer goes to server j with probability P ij, where P = j ij Let π be the statioary probabilities for the Markov chai describig the sequece of servers visited by a customer: k = = π π P, π j i ij j i= j= k The the probability distributio of the umber at each server is j k π k j Pm(, 2,..., k) = Cm if j = m j= µ j j= Chapter 8 7
CQN Performace Computatio of the ormalizig costat C m to get the statioary distributio ca be legthy; but may be mostly j iterested i the throughput λm = ( ) j = λ m j where λ m (j) is the arrival rate to (ad departure rate from) j. Arrival Theorem: I the CQN with m customers, the system as see by arrivals to server j has the same distributio as the whole system whe it cotais oly m- customers. This leads to mea value aalysis to fid λ m (j) alog with W m (j) = the average time a customer speds at server j, ad L m (j) = the average umber of customers at server j. Chapter 8 8
Mea Value Aalysis Solve iteratively: W m ( j) = + Lm µ j ( j) ( ) ( ) ( ), where ( ) L j = λ j W j λ j = π λ m m m m j m Begi with W ( j) λ m = µ j k i= m = throughput π W i m () i Chapter 8 9
M/G/ Best combiatio of tractability & usefuless Assumptio of Poisso arrivals may be reasoable based o Poisso approximatio to biomial distributio may potetial customers decide idepedetly about arrivig (arrival = success ), - each has small probability of arrivig i ay particular time iterval Probability of arrival i a small iterval is approximately proportioal to the legth of the iterval o bulk arrivals Amout of time sice last arrival gives o idicatio of amout of time util the ext arrival (expoetial memoryless) Chapter 8 20
M/G/ Best combiatio of tractability & usefuless Expoetial distributio is frequetly a bad model for service times memorylessess large probability of very short service times with occasioal very log service times May ot wat to use oe of the stadard distributios for service times, either i a real situatio, collect data o service times ad fit a empirical distributio Distributios of umber of customers i the system ad waitig time deped o service time distributio to be specified Chapter 8 2
M/G/ Best combiatio of tractability & usefuless Assumptio of Poisso arrivals may be reasoable based o Poisso approximatio to biomial distributio may potetial customers decide idepedetly about arrivig (arrival = success ), - each has small probability of arrivig i ay particular time iterval - Distributios of umber of customers i the system ad waitig time deped o service time distributio Chapter 8 22
M/G/ Performace How may customers? How much time? S is the legth of a arbitrary service time (radom variable) λ is the arrival rate of customers; defie ρ = λe[s] ad assume it is <. Expected values ca be foud from geeralizig Little s formula from # customers i the system to amout of work i the system: A arrivig customer brigs S time uits of work: The time average amout of work i the system (V) = λ * the customer average amout of work remaiig i the system Chapter 8 23
Work Cotet W Q * is the (radom variable) waitig time i queue Expected amout of work per customer is S * E SWQ + ( S x) dx 0 Work remaiig 2 E S * = E SW Q + 2 Eter Begi Depart If a customer s service time service is idepedet of ow wait i queue, get average work i system 2 λe S * V = λe[ S] E W Q + 2 S Chapter 8 24
Mea waitig time W Q = Customer mea waitig time = average work i the system whe a customer arrives From PASTA, W Q = V. Therefore, (Pollaczek-Khitchie formula) 2 2 λe S λe S WQ = λe[ S] WQ + W Q = 2 2 Ad the other measures of performace are: [ ] ( λe S ) [ ] ( λe S ) 2 2 λ E S LQ = λwq =, W = WQ + E[ S], L= λw 2 Chapter 8 25
Priority Queues Differet types of customers may differ i importace. Type i customers arrive accordig to a Poisso process with rate λ i ad require service times with distributio G i, i =, 2. Type customers have (opreemptive) priority: service does ot begi o a type 2 customer if there is a type customer waitig. If a type customer arrives durig a type 2 service, the service is cotiued to completio. What is the average wait i queue of a type i customer, i W Q Chapter 8 26
Two customer types w/o priority λ λ2 M/G/ model with λ = λ+ λ2 G x = G x + G2 x λ λ Average work i system is ( 2 2 ( ) ( ) ) 2 λe S λ λ λ E S λ2 λ E S + 2 V = = 2 λe S 2 λ λ λ E S + λ λ E S = ( [ ]) λ 2 2 E S + λ2e S2 ( λe[ S] λ2e[ S2] ) 2 ( ) ( ) ( ) (( ) [ ] ( 2 ) [ 2] ) ( ) If the server is ot allowed to be idle whe the system is ot empty, this quatity is the same for the system with priority. Chapter 8 27
Two customer types with priority Let V i be the average amout of type i work i the system 2 i i i i V ie[ Si] W λ E S = λ Q + 2 i queue i service i V Q Now focus o a type customer. Waitig time = amt. of type work i system + amt. of type 2 work i service whe this customer arrives, so 2 2 E S 2E S 2 2 WQ V VS E[ S] W λ λ = + = λ Q + + 2 2 i V S Chapter 8 28
Two customer types with priority W Q 2 2 λe S + λ2e S 2 = if λe[ S] < 2 [ ] ( λ E S ) But a type 2 customer has to wait for everyoe ahead, plus ay type customers who arrive durig the type 2 wait, so [ ] W = V + λ E S W W = 2 2 2 Q Q Q 2 2 λe S λ2e S + 2 2 [ ] [ ] λe[ S ] λ E[ S ] ( λe S λ E S )( λ E[ S ]) 2 2 if + < 2 2 Chapter 8 29
M/M/k Model k idetical machies i parallel, Poisso arrivals (rate λ), expoetial service times (rate µ) CTMC (birth-death) model: Chapter 8 30
M/M/k Steady-State Probabilities Level-crossig equatios: λ P = ( + ) µ P+, = 0,,..., k λ P = kµ P, = k, k+,... + Defie ρ=λ/kµ, solve for P i terms of P 0 P ( kρ )! P0, = 0,,..., k = k k ρ k! P0, = k+, k+ 2,... P =, r = ( r) if r < The use the facts that = 0 = 0 to get k k ( kρ) ( kρ) P0 = + if ρ = 0 <! ( ρ) k! ρ is the utilizatio of each server Chapter 8 3
M/M/k Performace Measures Steady-state expected umber of customers i the system Mea flow time k ( kρ) ρ L= P 0 = kρ+ P 2 0, if ρ = < k! ( ρ) k L ( kρ) W = = + P0 by Little's Formula λ µ kµ - λ k!( ρ) Expected waitig time WQ = W µ Expected umber i the queue (kρ is expected umber of busy servers) L = λw = L kρ Q Q Chapter 8 32
Erlag Loss System M/M/k/k system: k servers ad a capacity of k: a arrival who fids all servers busy does ot eter the system (is lost) ( kρ) P = P0, = 0,,..., k! i ( kρ) k ( kρ) Pi = 0, i = 0,..., k = i!! Above is called Erlag s loss formula, ad it holds for M/G/k/k as well, if kρ = λe S [ ] Chapter 8 33