Elementary queueing system Kendall notation Little s Law PASTA theorem Basics of M/M/1 queue 1
History of queueing theory An old research area Started in 1909, by Agner Erlang (to model the Copenhagen telephone exchange in Denmark) Booming after 1950 s, to model computer/communication/ David G. Kendall introduced an A/B/C queueing notation in 1953 used in modern packet switching networks in the early 1960s by Leonard Kleinrock (UCLA, his book) A branch of operations research Agner Erlang 1878-1929, Denmark 2
Model and analysis tool Modeling and analyze many systems Telephony systems, exchanger of telephone lines Computer systems Communication systems Transportation systems Production systems Hospital/banks/ Limitation Too restrictive, some assumptions Use other alternative methods, simulation/tools, 3
A general queueing system A general queuing system Customer arrival Customer departure waiting room Service facility A generic model dlfor Machine, computer system, communication system, intersection of roads, etc. 4
The basic elements of queueing system Arrival process of customers Interarrival time i.i.d., e.g, Poisson arrival Arrival one by one, or in batches, etc. Bh Behavior of customers Patient or impatient; different type of customers Service time i.i.d., i e.g., exponential; load/state dependent; 5
The basic elements of queueing Service discipline system (cont.) FCFS: first come first serve, LCFS: last come first serve (stack), RS: randomly serve, priority, SRPT: shortest remaining processing time first, PS: processor sharing Service capacity (number of servers) Single server or a group of servers Waiting room (system capacity) Finite or infinite; buffer size design 6
Kendall notation A family of notation symbols for different categories of queues Proposed by David G. Kendall in 1953 Professor of Oxford Univ. (1946 1962) and Cambridge Univ. (1962 1985) David G. Kendall 1918-2007, England 7
Kendall notation (cont.) A family of notation symbols for different categories of queues A/B/C/K/N/D A: distribution of interarrival time, M or G or D B: distribution of service time, M or G or D C: number of servers K: system capacity, infinite by default N: number of total customers, infinite by default D: the service discipline For default, K =, N = and D = FCFS 8
Example of Kendall notation M/M/1; M/G/1; G/M/1; G/G/1; M/D/1; M/Er/1; PH/G/1; M/M/c; M/M/1/B; M/M/ //N M/M/c/K/N/ /K/N/ M/M/c/K//LCFS / / // M/M/1///PS 9
A small joke Different of type of queue. 10
Utilization factor For a queue with single server λ: the arrival rate of customers x Utilization factor: : the mean service time Physical meaning: ρ: = λ x Single server: time fraction that server is busy Multiple server: fraction of busy servers ρ = λx / m Traffic intensity is defined as r: = λx for single or multiple servers 11
Performance measures Distribution of performance measures Distribution of waiting time W and sojourn time T of customers; E{W}, Var{W}, Pr{W>t} Distribution of number of customers in the queue N or in the system N q ; E{N}, Var{N}, Pr{N>n} Distribution of busy period of the server BP; E{BP}, Var{BP}, Pr{BP>t} Mean of performance measures Mean waiting time, mean sojourn time/mean response time; Average customer number, average queue length Average length ofbusyperiod Throughput of the system Open system: equals the arrival rate; Closed system: needs calculation and analysis 12
The Little s Law Named after John Little, (1928 ), professor of MIT For a stable queueing system, we have L: average number of customers in the system λ: arrival rate, average number of arrivals per unit time T: mean response time/sojourn time of customers L = λt 13
The Little s Law (cont.) Apply it to the queue (excluding the server) L q: average number of customers in the queue λ: arrival rate, average number of arrivals per unit time W: mean waiting time of customers Lq = λw 14
The Little s Law (cont.) Apply it to the server only ρ: average number of customers in the server, λ: average number of arrivals to the server per unit time x : mean service time of customers ρ = λxλ For M/M/1, we have ρ = λ μ 15
The Little s Law (cont.) Applicability Very general, G/G/c / Applicable to any queue which is STABLE Applicable to any subsystem of the queue Limitation Inapplicable to unstable queue Only mean metrics, inapplicable to study the transient metrics 16
PASTA Theorem Poisson Arrivals See Time Averages For queues with Poisson arrivals, M/./. The arriving customers find the same mean measures as that observed by an outside observer at an arbitrary point of time Intuitively i explained li dby the fact that Poisson arrivals occurs completely random in time (purely random sampling) 17
PASTA Theorem (cont.) Applicable to any queues with Poisson arrival M/M/1, M/G/1, etc. Not valid for some queues, e.g., D/D/1 Empty pyat time 0, arrive at 1,3,5,, service time is 1. Arrivals see empty queue, while average number of customers is 1/2 Little s Law and PASTA theorem is very fundamental and important in queueing theory E.g., Mean Value Analysis (MVA) for queueing networks Calculate the mean performance metrics, L, W, T, etc. 18
M/M/1 queue System parameters Poisson arrival rate λ,, service rate μ Infinite capacity, FCFS Study the performance metrics ti Customer arrival Customer departure waiting room Service facility 19
Dynamics of M/M/1 / queue server queue C 1 C 2 C 3 Departure Start t C 1 C 2 C 3 C 4 service 0 1 2 3 4 5 6 7 8 9 10 11 t t C 1 C 2 C 3 C 4 Arrival 1 2 3 4 # of customer 2 1 0 1 2 3 4 5 6 7 8 9 10 11 t 20
State transition rate diagram of M/M/1 State transition rate diagram state: the number of customers in the system λ λ λ λ λ λ 0 1 2 k 1 k k+1 μ μ μ μ μ μ μ A simple birth death process 21
Equilibrium behavior of M/M/1 When the system reaches steady Global balance equation π λ = π μ 0 1 n + n + 1 + n 1 n π ( λ+ μ ) = π μ+ π λ, = 1,2,... Local balance equation π nλ = πn+ 1 μ, n = 0,1,2,... Normalization equation n=00 π n = 1 22
Equilibrium behavior of M/M/1 Chalk writing (cont.) Derive the steady state distribution 1 n n π n = = (1 ) G ρ ρ ρ G is called the normalization constant, G=1/(1 ρ) 3 more ways to solve the local balance equation recursion, Z transform, direct approach of solving difference equation Very simple to solve the local balance equation 23
Key performance metrics of M/M/1 (time average metrics) Average number of customers in the system, L We have L nπn n(1 ) Variance is ρ/(1 ρ) 2 Pr{n k}: Pr{ n k} = k π = ρ ρ 1 n = = ρ ρ = n= 0 n= 0 1 ρ Use dev. to void integration by Pr{ } i i= k parts! Trick. Average queue length (excluding the customer being served) We have Chalk writing The curve of L w.r.t. ρ 2 ρ L = q ( n 1) π n = L ρ = n= 1 1 ρ 24
Key performance metrics of M/M/1 (customer average metrics) Mean response time of customers T By Little s law, we have T = L/ λ = 1 μ λ Mean waiting time of customers (excluding the service time) We have 1 λ ρ μ μ( μ λ) μ λ Chalk writing W = T = = = ρt The curve of T, W w.r.t. ρ Example, double λ and μ, how are L,T,W changing? 25
Another way to calculate mean performance metrics (MVA) Mean Value Analysis (MVA) Combine the Little s law and PASTA theorem No need to know the distribution of steady state Analysis process Seen by an arriving customer, mean response time is (should be equivalent to T by PASTA) T=L/μ+1/μ Little s law: L=λT Called arrival relation Combine to obtain: T= 1/(μ λ), L= ρ/(1 ρ), etc. 26
Distribution of sojourn time We focus on an arriving customer S: the sojourn time of the arriving customer L q : # of customers in the system seen by the arrival B k1 k : service time of the kth customer, k=1,, L q We have a L + 1 k = 1 S = B k Since B k and L q are independent, we further have a L + 1 n+ 1 k k k= 1 n= 0 k= 1 a P( S > t) = P B > t = P B > t P( L = n) 27
Distribution of sojourn time (cont.) By PASTA theorem, a n P( L = n) = π = (1 ρρ ) n+ 1 P B k > t is a n+1 stage Erlang distribution So, k = 1 n The sojourn time is exponentially distributed with parameter μ(1 ρ). Interesting! 28
Distribution of sojourn time (cont.) Another easy way is using Laplace transform Since we have The above is an exponential distribution with parameter μ(1 ρ). ) (1 ) t PS ( > t) = e μ ρ 29
Distribution of waiting time, W Since S=W+B, so We have W=0 with probability 1 ρ; W is exponentially distributed with parameter μ(1 ρ) with probability ρ. 30
Busy period # of customer 2 1 0 1 2 3 4 5 6 7 8 9 10 11 t Busy Idle period period IP(idle period) is exponentially distributed with parameter λ Mean busy period: 1/ μ EBP ( ) = 1 ρ So, it equals T. EBP ( ) EBP ( ) = = ρ EBP ( ) + EIP ( ) EBP ( ) + 1/ λ 31
Distribution of busy period It is complicated use Laplace transform and recursion analysis Omitted for simplicity pdf of BP: Where I 1 (.) is the modified Bessel function of the first kind of order 1, 32