Queues Stability Average Computable queues Networks Multiclass networks
Performance Evaluation : Contention and Queues Stochastic Modeling of Computer Systems MOSIG Master 2
Jean-Marc Vincent
Laboratoire LIG, projet Inria-Mescal UniversitéJoseph Fourier [email protected]
2012 October 19
Performance Evaluation : Contention and Queues 1 / 49 Queues Stability Average Computable queues Networks Multiclass networks Outline
1 Queues Characterization
2 Stability
3 Average
4 Computable queues
5 Networks
6 Multiclass networks
Performance Evaluation : Contention and Queues 2 / 49 Queues Stability Average Computable queues Networks Multiclass networks Queues
Queues are among simplest dynamic systems, but are still the source of many open problems. Tasks do not have any constraints, sizes and arrival times are often independent.
Performance Evaluation : Contention and Queues 3 / 49 Queues Stability Average Computable queues Networks Multiclass networks Queues
Queues are among simplest dynamic systems, but are still the source of many open problems. Tasks do not have any constraints, sizes and arrival times are often independent.
Performance Evaluation : Contention and Queues 3 / 49 Queues Stability Average Computable queues Networks Multiclass networks Queues
Queues are among simplest dynamic systems, but are still the source of many open problems. Tasks do not have any constraints, sizes and arrival times are often independent.
Performance Evaluation : Contention and Queues 3 / 49 Queues Stability Average Computable queues Networks Multiclass networks Queues
Queues are among simplest dynamic systems, but are still the source of many open problems. Tasks do not have any constraints, sizes and arrival times are often independent.
Performance Evaluation : Contention and Queues 3 / 49 Queues Stability Average Computable queues Networks Multiclass networks Queues
Queues are among simplest dynamic systems, but are still the source of many open problems. Tasks do not have any constraints, sizes and arrival times are often independent.
Performance Evaluation : Contention and Queues 3 / 49 Queues Stability Average Computable queues Networks Multiclass networks Queues
Queues are among simplest dynamic systems, but are still the source of many open problems. Tasks do not have any constraints, sizes and arrival times are often independent.
Performance Evaluation : Contention and Queues 3 / 49 Queues Stability Average Computable queues Networks Multiclass networks Kendall’s notation
Service Process Queue total capacity C Service rate µ
Arrival Process arrival rate λ
Rejection/blocking policy
Number of servers K
Notation : A/S/K /C/Disc
A : arrival process B : service process K : number of servers C : total queue capacity (including currently served customers) Disc : Service discipline (FIFO, LIFO, PS, Quantum, Priorities,...)
Performance Evaluation : Contention and Queues 4 / 49 Queues Stability Average Computable queues Networks Multiclass networks State variables
User variables Input rate λ or inter-arrival δ Service time σ or S (service rate µ) Waiting time W Response time R (in some books W ) Rejection probability
Resource variables Resource utilisation (offered load) ρ Queue occupation N System availability
Performance Evaluation : Contention and Queues 5 / 49 Queues Stability Average Computable queues Networks Multiclass networks One Server Queue load
aa1a23a45 a a6
δ δ δ δ δ δ 3245 61 σ W(t) 4
σ σ 2 3
σ 5
σ 1 σ 6
t 0 0
d1 dd2d3d45
Performance Evaluation : Contention and Queues 6 / 49 Queues Stability Average Computable queues Networks Multiclass networks Lindley’s formula (2)
Wn is the waiting time of the n-th task. It is a dynamical system of the form Wn = ϕ(Wn−1, Xn) with Xn = σn−1 − δn and ϕ defined by the
Lindley’s equation:
Wn = max (Wn−1 + Xn, 0) .
- FIFO scheduling - Non-linear evolution equation
Performance Evaluation : Contention and Queues 7 / 49 Queues Stability Average Computable queues Networks Multiclass networks Outline
1 Queues
2 Stability
3 Average
4 Computable queues
5 Networks
6 Multiclass networks
Performance Evaluation : Contention and Queues 8 / 49 Queues Stability Average Computable queues Networks Multiclass networks Stability of the G/G/1 queue
Wn = max (Wn−1 + Xn, 0) ,
= max (max(Wn−2 + Xn−1, 0) + Xn, 0) ,
= max (Wn−2 + Xn−1 + Xn, Xn, 0) ,
= max (Wn−3 + Xn−2 + Xn−1 + Xn, Xn−1 + Xn, Xn, 0) ,
= max (W0 + X1 + ··· + Xn−1 + Xn, ··· , Xn−1 + Xn, Xn, 0) ,
= max (X1 + ··· + Xn−1 + Xn, ··· , Xn−1 + Xn, Xn, 0) ,
∼ max (Xn + ··· + X2 + X1, ··· , X2 + X1, X1, 0) , def = Mn.
Wn =st Mn = max (Mn−1, X1 + ··· + Xn) .
Performance Evaluation : Contention and Queues 9 / 49 Queues Stability Average Computable queues Networks Multiclass networks Stability of the G/G/1 queue (2)
Wn =st Mn = max (Mn−1, X1 + ··· + Xn) .
Mn is a non-decreasing sequence Either Mn −→ M∞ or Mn −→ +∞
Stability
EX = E(σ − δ) < 0 The system is Stable
M∞ =st max(M∞ + X, 0). Functional equation on the distribution
def Z P(M∞ < x) = F(x) = F(x − u)dFX (u).
Condition : Eσ < Eδ or λ < µ EX = E(σ − δ) > 0 The system is Unstable Depends only on service and inter-arrival expectation
Performance Evaluation : Contention and Queues 10 / 49 Queues Stability Average Computable queues Networks Multiclass networks Loynes’ scheme
Theorem
Wn 6st Wn+1 in a G/G/1 queue, initialy empty. Proof. done by a backward coupling known as the Loynes’ scheme. Construct on a common probability space two trajectories by going backward 1 2 1 2 in time: Si−n(ω) = Si−n−1(ω) with distribution Si and Ti−n(ω) = Ti−n−1(ω), 1 with distribution Ti − Tn+1 for all 0 6 i 6 n + 1 and S−n−1(ω) = 0. 1 2 By construction, W0 =st Wn and W0 =st Wn+1. Also, it should be clear that 1 2 0 = W−n+1(ω) 6 W−n+1(ω) for all ω. 1 2 This implies W−i (ω) 6 W−i (ω) so that Wn 6st Wn+1.
Performance Evaluation : Contention and Queues 11 / 49 Queues Stability Average Computable queues Networks Multiclass networks Loynes’ scheme
Theorem
Wn 6st Wn+1 in a G/G/1 queue, initialy empty. Proof. done by a backward coupling known as the Loynes’ scheme. Construct on a common probability space two trajectories by going backward 1 2 1 2 in time: Si−n(ω) = Si−n−1(ω) with distribution Si and Ti−n(ω) = Ti−n−1(ω), 1 with distribution Ti − Tn+1 for all 0 6 i 6 n + 1 and S−n−1(ω) = 0. 1 2 By construction, W0 =st Wn and W0 =st Wn+1. Also, it should be clear that 1 2 0 = W−n+1(ω) 6 W−n+1(ω) for all ω. 1 2 This implies W−i (ω) 6 W−i (ω) so that Wn 6st Wn+1.
Performance Evaluation : Contention and Queues 11 / 49 Queues Stability Average Computable queues Networks Multiclass networks Loynes’ scheme
Theorem
Wn 6st Wn+1 in a G/G/1 queue, initialy empty. Proof. done by a backward coupling known as the Loynes’ scheme. Construct on a common probability space two trajectories by going backward 1 2 1 2 in time: Si−n(ω) = Si−n−1(ω) with distribution Si and Ti−n(ω) = Ti−n−1(ω), 1 with distribution Ti − Tn+1 for all 0 6 i 6 n + 1 and S−n−1(ω) = 0. 1 2 By construction, W0 =st Wn and W0 =st Wn+1. Also, it should be clear that 1 2 0 = W−n+1(ω) 6 W−n+1(ω) for all ω. 1 2 This implies W−i (ω) 6 W−i (ω) so that Wn 6st Wn+1.
Performance Evaluation : Contention and Queues 11 / 49 Queues Stability Average Computable queues Networks Multiclass networks Loynes’ scheme
2 W0 1 W0 T − T −Tn+1 i n+1 0
This has many consequences in terms of existence and uniqueness of a stationary (or limit) regime for the G/G/1 queue Baccelli Bremaud, 2002).
Performance Evaluation : Contention and Queues 12 / 49 Queues Stability Average Computable queues Networks Multiclass networks Loynes’ scheme
2 W0 1 W0 T − T −Tn+1 i n+1 0
This has many consequences in terms of existence and uniqueness of a stationary (or limit) regime for the G/G/1 queue Baccelli Bremaud, 2002).
Performance Evaluation : Contention and Queues 12 / 49 Queues Stability Average Computable queues Networks Multiclass networks Outline
1 Queues
2 Stability
3 Average
4 Computable queues
5 Networks
6 Multiclass networks
Performance Evaluation : Contention and Queues 13 / 49 Queues Stability Average Computable queues Networks Multiclass networks Little’s Formula
At
Nt
Rn
Assumptions Z t n At 1 1 X lim = λ, lim Nsds = EN and lim Ri = ER, t→+∞ t t→+∞ t n→+∞ n 0 i=1
Little’s Formula EN = λER.
Performance Evaluation : Contention and Queues 14 / 49 Queues Stability Average Computable queues Networks Multiclass networks Little’s Formula (proof)
Client
a1 a2 a3 a4 a5 a6 a7 a8 a9 d1 d3 d2 d1 d7 d6 d1 d8 Time
Nt
Z T AT 1 AT 1 X Nsds = Ri . T T AT 0 i=1
T → ∞ implies EN = λER.
Performance Evaluation : Contention and Queues 15 / 49 Queues Stability Average Computable queues Networks Multiclass networks Little’s Formula (proof)
Client
a1 a2 a3 a4 a5 a6 a7 a8 a9 d1 d3 d2 d1 d7 d6 d1 d8 Time
Nt
Z T AT 1 AT 1 X Nsds = Ri . T T AT 0 i=1
T → ∞ implies EN = λER.
Performance Evaluation : Contention and Queues 15 / 49 Queues Stability Average Computable queues Networks Multiclass networks Little’s Formula (proof)
Client
a1 a2 a3 a4 a5 a6 a7 a8 a9 d1 d3 d2 d1 d7 d6 d1 d8 Time
Nt
Z T AT 1 AT 1 X Nsds = Ri . T T AT 0 i=1
T → ∞ implies EN = λER.
Performance Evaluation : Contention and Queues 15 / 49 Queues Stability Average Computable queues Networks Multiclass networks Outline
1 Queues
2 Stability
3 Average
4 Computable queues Single server queue Limited capacity
5 Networks
6 Multiclass networks
Performance Evaluation : Contention and Queues 16 / 49 Queues Stability Average Computable queues Networks Multiclass networks M/M/1
Infinite capacity λ µ Poisson(λ) arrivals Exp(µ) service times M/M/1 queue FIFO discipline
Definition λ ρ = µ is the traffic intensity of the queueing system.
Performance Evaluation : Contention and Queues 17 / 49 Queues Stability Average Computable queues Networks Multiclass networks M/M/1
Infinite capacity λ µ Poisson(λ) arrivals Exp(µ) service times M/M/1 queue FIFO discipline
Definition λ ρ = µ is the traffic intensity of the queueing system.
Performance Evaluation : Contention and Queues 17 / 49 Queues Stability Average Computable queues Networks Multiclass networks M/M/1
Let X(t) the number of clients in the system at time t. X(t) is a birth and death process.
λ λ λ λ λ λ λ 0134 n − 1 n n + 1 µ µ µ µ µ µ µ
Results for M/M/1 queue
1 Stable if and only if ρ < 1 i 2 Clients follow a geometric distribution ∀i ∈ N, πi = (1 − ρ)ρ 3 ρ Mean number of clients EX = (1−ρ)
4 1 Average response time ET = µ−λ
Performance Evaluation : Contention and Queues 18 / 49 Queues Stability Average Computable queues Networks Multiclass networks M/M/1
Let X(t) the number of clients in the system at time t. X(t) is a birth and death process.
λ λ λ λ λ λ λ 0134 n − 1 n n + 1 µ µ µ µ µ µ µ
Results for M/M/1 queue
1 Stable if and only if ρ < 1 i 2 Clients follow a geometric distribution ∀i ∈ N, πi = (1 − ρ)ρ 3 ρ Mean number of clients EX = (1−ρ)
4 1 Average response time ET = µ−λ
Performance Evaluation : Contention and Queues 18 / 49 Queues Stability Average Computable queues Networks Multiclass networks M/M/1
Let X(t) the number of clients in the system at time t. X(t) is a birth and death process.
λ λ λ λ λ λ λ 0134 n − 1 n n + 1 µ µ µ µ µ µ µ
Results for M/M/1 queue
1 Stable if and only if ρ < 1 i 2 Clients follow a geometric distribution ∀i ∈ N, πi = (1 − ρ)ρ 3 ρ Mean number of clients EX = (1−ρ)
4 1 Average response time ET = µ−λ
Performance Evaluation : Contention and Queues 18 / 49 Queues Stability Average Computable queues Networks Multiclass networks M/M/1
Let X(t) the number of clients in the system at time t. X(t) is a birth and death process.
λ λ λ λ λ λ λ 0134 n − 1 n n + 1 µ µ µ µ µ µ µ
Results for M/M/1 queue
1 Stable if and only if ρ < 1 i 2 Clients follow a geometric distribution ∀i ∈ N, πi = (1 − ρ)ρ 3 ρ Mean number of clients EX = (1−ρ)
4 1 Average response time ET = µ−λ
Performance Evaluation : Contention and Queues 18 / 49 Queues Stability Average Computable queues Networks Multiclass networks M/M/1/C
In reality, buffers are finite: M/M/1/C is a queueing system with rejection.
C λ µ
Rejection
λ λ λ λ λ 0134 C − 1 C µ µ µ µ µ
Results for M/M/1/C queue Geometric distribution with finite state space
(1 − ρ)ρi π(i) = 1 − ρC+1
Performance Evaluation : Contention and Queues 19 / 49 Queues Stability Average Computable queues Networks Multiclass networks Outline
1 Queues
2 Stability
3 Average
4 Computable queues
5 Networks Tandem queues Jackson networks Open networks of M/M/c queues
6 Multiclass networks
Performance Evaluation : Contention and Queues 20 / 49 Queues Stability Average Computable queues Networks Multiclass networks Reversibility
Proposition An ergodic birth and death process is time-reversible.
Proof
λ λi−1 λi λi+1 λ0 λ1 i−2
i−1 i+1 . .. 0 1 ... i
µ µ µ µi+2 µ1 µ2 i−1 i i+1
By induction:
1 π0λ0 = π1µ1
2 Suppose πi−1λi−1 = πi µi . Then πi (λi + µi ) = πi+1µi+1 + πi−1λi−1 Which gives πi λi = πi+1µi+1.
Performance Evaluation : Contention and Queues 21 / 49 Queues Stability Average Computable queues Networks Multiclass networks Reversibility
Proposition An ergodic birth and death process is time-reversible.
Proof
λ λi−1 λi λi+1 λ0 λ1 i−2
i−1 i+1 . .. 0 1 ... i
µ µ µ µi+2 µ1 µ2 i−1 i i+1
By induction:
1 π0λ0 = π1µ1
2 Suppose πi−1λi−1 = πi µi . Then πi (λi + µi ) = πi+1µi+1 + πi−1λi−1 Which gives πi λi = πi+1µi+1.
Performance Evaluation : Contention and Queues 21 / 49 Queues Stability Average Computable queues Networks Multiclass networks Reversibility
Proposition An ergodic birth and death process is time-reversible.
Proof
λ λi−1 λi λi+1 λ0 λ1 i−2
i−1 i+1 . .. 0 1 ... i
µ µ µ µi+2 µ1 µ2 i−1 i i+1
By induction:
1 π0λ0 = π1µ1
2 Suppose πi−1λi−1 = πi µi . Then πi (λi + µi ) = πi+1µi+1 + πi−1λi−1 Which gives πi λi = πi+1µi+1.
Performance Evaluation : Contention and Queues 21 / 49 Queues Stability Average Computable queues Networks Multiclass networks Burke’s theorem
Theorem The output process of an M/M/s queue is a Poisson process that is independent of the number of customers in the queue.
Sketch of Proof.
λ
i i+1
µ
X(t) increases by 1 at rate λπi (Poisson process λ). Reverse process increases by 1 at rate µπi+1= λπi by reversibility.
Performance Evaluation : Contention and Queues 22 / 49 Queues Stability Average Computable queues Networks Multiclass networks Burke’s theorem
Theorem The output process of an M/M/s queue is a Poisson process that is independent of the number of customers in the queue.
Sketch of Proof.
λ
i i+1
µ
X(t) increases by 1 at rate λπi (Poisson process λ). Reverse process increases by 1 at rate µπi+1= λπi by reversibility.
Performance Evaluation : Contention and Queues 22 / 49 Queues Stability Average Computable queues Networks Multiclass networks Open Queueing Networks
λ µ1 µ2
Let X1 and X2 denote the number of clients in queues 1 and 2 respectively.
Lemma
X1 and X2 are independent rv’s.
Proof Arrival process at queue 1 is Poisson(λ) so future arrivals are independent of X1(t). By time reversibility X1(t) is independent of past departures. Since these departures are the arrival process of queue 2, X1(t) and X2(t) are independent.
Performance Evaluation : Contention and Queues 23 / 49 Queues Stability Average Computable queues Networks Multiclass networks Open Queueing Networks
λ µ1 µ2
Let X1 and X2 denote the number of clients in queues 1 and 2 respectively.
Lemma
X1 and X2 are independent rv’s.
Proof Arrival process at queue 1 is Poisson(λ) so future arrivals are independent of X1(t). By time reversibility X1(t) is independent of past departures. Since these departures are the arrival process of queue 2, X1(t) and X2(t) are independent.
Performance Evaluation : Contention and Queues 23 / 49 Queues Stability Average Computable queues Networks Multiclass networks Open Queueing Networks
λ µ1 µ2
Let X1 and X2 denote the number of clients in queues 1 and 2 respectively.
Lemma
X1 and X2 are independent rv’s.
Proof Arrival process at queue 1 is Poisson(λ) so future arrivals are independent of X1(t). By time reversibility X1(t) is independent of past departures. Since these departures are the arrival process of queue 2, X1(t) and X2(t) are independent.
Performance Evaluation : Contention and Queues 23 / 49 Queues Stability Average Computable queues Networks Multiclass networks Open Queueing Networks
Theorem The number of clients at server 1 and 2 are independent and
λ n1 λ λ n2 λ P(n1, n2) = 1 − 1 − µ1 µ1 µ2 µ1
Proof
By independence of X1 and X2 the joint probability is the product of M/M/1 distributions. This result is called a product-form result for the tandem queue. This product form also appears in more general networks of queues.
Performance Evaluation : Contention and Queues 24 / 49 Queues Stability Average Computable queues Networks Multiclass networks Open Queueing Networks
Theorem The number of clients at server 1 and 2 are independent and
λ n1 λ λ n2 λ P(n1, n2) = 1 − 1 − µ1 µ1 µ2 µ1
Proof
By independence of X1 and X2 the joint probability is the product of M/M/1 distributions. This result is called a product-form result for the tandem queue. This product form also appears in more general networks of queues.
Performance Evaluation : Contention and Queues 24 / 49 Queues Stability Average Computable queues Networks Multiclass networks Open Queueing Networks
Theorem The number of clients at server 1 and 2 are independent and
λ n1 λ λ n2 λ P(n1, n2) = 1 − 1 − µ1 µ1 µ2 µ1
Proof
By independence of X1 and X2 the joint probability is the product of M/M/1 distributions. This result is called a product-form result for the tandem queue. This product form also appears in more general networks of queues.
Performance Evaluation : Contention and Queues 24 / 49 Queues Stability Average Computable queues Networks Multiclass networks Open Queueing Networks
Example of a feed-forward network:
0 0 λi λk pik µi µk p pk0 il pi0 λ0 λ0 p jk l j µ µj l p jl pl0 p j0 Routing matrix Exponential service times output of i is routed to j with probability pij 0 pij pik pil 0 pji 0 pjk pjl external traffic arrives at i with rate λi R = p p 0 p packets exiting queue i leave the system with ki kj jl pli plj plk 0 probability pi0.
Performance Evaluation : Contention and Queues 25 / 49 The resulting process M(t) of successes is a Poisson process with rate λp. The process of failures L(t) is a Poisson process with rate λ(1 − p) and is independent of M(t).
Queues Stability Average Computable queues Networks Multiclass networks Open Queueing Networks
Reminder N(t) Poisson process with rate λ Z (n) sequence of iid rv’s ∼ Bernoulli(p) independent of N. Suppose the nth trial is performed at the nth arrival of the Poisson process.
Poisson(λ) p Bernoulli
1−p
Performance Evaluation : Contention and Queues 26 / 49 The process of failures L(t) is a Poisson process with rate λ(1 − p) and is independent of M(t).
Queues Stability Average Computable queues Networks Multiclass networks Open Queueing Networks
Reminder N(t) Poisson process with rate λ Z (n) sequence of iid rv’s ∼ Bernoulli(p) independent of N. Suppose the nth trial is performed at the nth arrival of the Poisson process. The resulting process M(t) of successes is a Poisson process with rate λp.
Poisson(λ) p Bernoulli Poisson(λp)
1−p
Poisson(λ(1 − p))
Performance Evaluation : Contention and Queues 26 / 49 Queues Stability Average Computable queues Networks Multiclass networks Open Queueing Networks
Reminder N(t) Poisson process with rate λ Z (n) sequence of iid rv’s ∼ Bernoulli(p) independent of N. Suppose the nth trial is performed at the nth arrival of the Poisson process. The resulting process M(t) of successes is a Poisson process with rate λp. The process of failures L(t) is a Poisson process with rate λ(1 − p) and is independent of M(t).
Poisson(λ) p Bernoulli Poisson(λp)
1−p
Poisson(λ(1 − p))
Performance Evaluation : Contention and Queues 26 / 49 Queues Stability Average Computable queues Networks Multiclass networks Open Queueing Networks
0 0 λi λk pik µi µk p pk0 Define λi the total arrival rate at queue il pi0 0 i, 1 i K . 0 jk λl 6 6 λj p µ µj l p jl pl0 pj0 No feedback : from Burke we can consider K independent M/M/1 queues with Poisson arrivals with rate λi , where
K 0 X ~ ~ 0 ~ λi = λi + λj pji Λ = Λ + ΛR j=0 in matrix notation.
Stability condition
λi < µi , ∀i = 1, 2,..., K .
Performance Evaluation : Contention and Queues 27 / 49 Queues Stability Average Computable queues Networks Multiclass networks Open Queueing Networks
0 0 λi λk pik µi µk p pk0 Define λi the total arrival rate at queue il pi0 0 i, 1 i K . 0 jk λl 6 6 λj p µ µj l p jl pl0 pj0 No feedback : from Burke we can consider K independent M/M/1 queues with Poisson arrivals with rate λi , where
K 0 X ~ ~ 0 ~ λi = λi + λj pji Λ = Λ + ΛR j=0 in matrix notation.
Stability condition
λi < µi , ∀i = 1, 2,..., K .
Performance Evaluation : Contention and Queues 27 / 49 Queues Stability Average Computable queues Networks Multiclass networks Open Queueing Networks