Download Lecture Slides on Basic Queueing Models - Inverse Problems in Imaging | CSC 790 and more Study notes Computer Science in PDF only on Docsity!
Basic Queueing Models
CSC 790 WAKE FORESTU N I V E R S I T Y Department of Computer Science Spring 2009
High Speed Networksp pCSC 790 Basic Queueing Models 1
Queueing Models
- The work by Erlang lead to several fundamental models
- Analysis of resource sharing systems
- Model consists of consumers and resources
- Customer demands are at random times
- Duration of use is also random
- If all the resources are used, the customer waits in queue
- Queueing theory addresses these type of systems
Little’s Theorem
- We have already established the relation N = λT where N is the average number of customers in the system, T is the average customer time in the system, and N is the average number of customers in the system
- Cannot specify these values further
- Need to know more about the statistics of the system Statistics about what?
- Given the statistics, we can then derive the wait time as well as the number of customers in the queue pn = probability of n customers in the system
E. W. Fulp Spring 2009
High Speed Networksp pCSC 790 Basic Queueing Models 3
Arrival Processes
- Assume customers arrive with interarrival times τ 1 , τ 2 , ...
- Also assume interarrival times are independent random variables with the same distribution
- The arrival rate to the system is
λ = (^) E^1 [τ ] customers/sec
- What can we say about the arrival pattern?
- Interarrival times are deterministic when interarrival times are all equal to the same constant What is an example? What does the PDF look like?
- Interarrival times are exponential if the interarrival times are exponential random variables with mean E[τ ] = 1/λ
Exponential
- Assume arrivals are Poisson distributed with rate λ
- What is the probability of no requests in an interval s?
P r{X = 0} = (λs)
0 0! e
−λs (^) = e−λs
- True for any interval (t, t + s) is e−λs, where t is arbitrary (remember the memoryless property )
- Let tn be the time of the nth^ arrival
- The probability the (n + 1)th^ arrives during (tn, tn + s) is
1 − e−λs
just the inverse of the probability of no arrivals during s
E. W. Fulp Spring 2009
High Speed Networksp pCSC 790 Basic Queueing Models 7
- More formally we say this is an exponential distribution P r{τ ≤ s} = 1 − e−λs, s ≥ 0 where τ = tn+1 − tn, it also known as a Poisson arrival process
- It is a memoryless process, allows tractable analytical results Suppose the lifetime of an appliance has an exponential distribution with an average of 10 years. After 3 years, the appliance is sold. What is the probability that it will not fail in the next 5 years?
(^00 2 4 6 8 )
probability
interarrival time
Exponential Distribution, rate = 2.
What?
- We were discussing queues and arrivals
- Now discussing exponential distribution, what went wrong?
- Remember the arrival pattern of packets (customers) is important
- We may know the average interarrival time between packets, but we need to also describe the variation
(^00 1 2 3 )
1
2
arrival
time
Rate = 2.
(^00 5 10 15 )
1
2
arrival
time
Rate = 2.
(^00 1 2 3 4 )
2
4
6
8
10
12
interarrival time
number of arrivals (^00 5 10 )
(^105) 1520
2530
3540
45
interarrival time
number of arrivals
E. W. Fulp Spring 2009
High Speed Networksp pCSC 790 Basic Queueing Models 9
Kendall Notation
- A queueing system is specified by the following information
- Arrival process, service mechanism, and queue discipline
- The Kendall notation was developed to define these values
- Kendall notation is a series of letters separated by “/” A/B/C/K/m/z
- Where the letters represent
- A is arrival process
- B is the service process
- C is the number of servers
- K is the maximum capacity of the queue (buffer), if it is an infinite queue (K=∞) it is typically omitted
- m is the population of customers (m = ∞ is assumed)
- z is the service discipline (FIFO is assumed)
- Consider a long-term flow of packets to the system
- Packets arrive at a rate λ packets/sec
- Maximum rate at which packets depart is μ packets/sec
- If λ > μ then the system will lose packets (unstable)
- If λ < μ then the system can handle the packets Would the case of λ < μ result in delays or lost packets?
- Want to develop models to quantify these effects
E. W. Fulp Spring 2009
High Speed Networksp pCSC 790 Basic Queueing Models 13
System Arrivals and Departures
- Consider what happens in the next Δt seconds
- In terms of arrivals there can be 0, 1, or > 1
- In terms of departures there can be 0, 1, or > 1
- But as Δt → 0 only one or or zero arrivals (or departures)
- If the interarrival times are exponential then P r{ 1 arrival in Δt} = λΔt + o(Δt) where o(Δt) denotes negligible terms relative to Δt Where did this equation come from?
- Similarly we can have no arrivals in Δt, P r{ 0 arrivals in Δt} = 1 − λΔt + o(Δt)
- If the departure times are exponential then
P r{ 1 departure in Δt} = μΔt + o(Δt)
- Similarly we can have no departures in Δt,
P r{ 0 departures in Δt} = 1 − μΔt + o(Δt)
which means the current customer (packet) will continue its service after Δt
- So we know the probabilities of arrivals and departures
- Combine these probabilities to model the state of the system
E. W. Fulp Spring 2009
High Speed Networksp pCSC 790 Basic Queueing Models 15
Steady State Probabilities
- We can now determine the probability of change in the system
- The probability of no arrivals or departures is
P r{ 0 arrivals and 0 departures in Δt} = (1 − μΔt + o(Δt))(1 − λΔt + o(Δt)) = 1 − (λ + μ)Δt + o(Δt)
also the probability the system is the same after Δt seconds
- The probability of one arrival and no departures is
P r{ 1 arrival and 0 departures in Δt} = (1 − μΔt + o(Δt))(λΔt + o(Δt)) = λΔt + o(Δt)
which is the probability the system increases by 1 after Δt seconds
pn+1 = λ μ pn, n = 0, 1 , ..., K
- Applying this definition recursively until p 0
pn+1 =
λ μ
)n pn, n = 0, 1 , ..., K
pn+1 = ρn+1p 0 where ρ = λ μ which is also utilization
- To find p 0 , we know that ∑^ K n=
pn = 1
p 0 + p 1 + p 2 + ... + pK = p 0 (1 + ρ + ρ^2 + ... + ρK^ ) = 1
E. W. Fulp Spring 2009
High Speed Networksp pCSC 790 Basic Queueing Models 19
p 0 = (^1 1) −^ − ρ^ kρ+
P r{N (t) = n} = pn = (1^ −^ ρ)ρ
n 1 − ρK+1^ ,^ for^ n^ = 0,^1 ,^2 , ..., K What is the probability of blocking or loss?
- Congratulations, you have just developed a Markov chain...
- Consider the probabilities as ρ varies
- If ρ < 1 (underload) then the system stays around state 0
- If ρ = 1 then each state is equally possible pn = (^) K^1 +
- If ρ > 1 (overload) then the system stays around state K
Number of Customers and Wait Time
- The average number of customers (packets) in the M/M/1/K
N =
∑^ K
n=
npn =
∑^ K
n=
n (1^ −^ ρ)ρ
n 1 − ρK+^
= ρ 1 − ρ −^
(K + 1)ρK+ 1 − ρK+
equation is not valid when ρ = 1, when ρ = 1 then N = K 2
- The average wait time (delay) is obtained using Little’s Theorem
T = (^) λ(1 −N p K ) Why is the denominator λ(1 − pK )?
E. W. Fulp Spring 2009
High Speed Networksp pCSC 790 Basic Queueing Models 21
M/M/
- Let’s consider the M/M/1 queue (K=∞)
- State transition diagram (Markov chain) is the same, except states can be any nonnegative integer
- Probabilities are still related by
pn+1 =
λ μ
)n p 0 = ρnp 0
- Still use the summation of the probabilities to find p 0 ∑^ ∞
i=
pi = p 0 + p 1 + p 2 + ... = p 0 (1 + ρ + ρ^2 + ...) = 1
p 0
1 − ρ
summation only converges if ρ < 1
Scale and Performance
Is it better to have m systems or one system that is m times as fast?
server
λ buffer μ
server
λ buffer μ
server
λ buffer μ server mλ buffer mμ
- Consider a set of m M/M/1 systems (parallel)
- The arrival rate to each system is λ packets/second
- Each system processes at a rate μ packets/second
- Consider a single M/M/1 system
- The arrival rate to the system is mλ packets/second
- The system processes at a rate mμ packets/second Does it make since to simply add the rates?
E. W. Fulp Spring 2009
High Speed Networksp pCSC 790 Basic Queueing Models 25
- The parallel system has a mean delay of
Tp = (^) μ(1 1 − ρ)
- The single system has a mean delay of
Ts = (^) mμ(1^1 − ρ)
- Since Ts = (^) m^1 Tp, the single system is better Why is this the case?
(^00) 0.2 0.4 0.6 0.8 1
2
4
6
8
10
average delay
utilization ρ
M/M/1 System Comparison Single systemParallel
Server Example
- Consider a LAN with 100 computers and a web server
- Average time for the server to respond is 0.6 seconds
- At peak times the requests rate is 20 requests/minute
- Web responses and requests are exponentially distributed
- Want to answer the following questions
- What is the average response time?
- If an additional 20% utilization is experienced, will response time increase by more or less than 20%?
E. W. Fulp Spring 2009
High Speed Networksp pCSC 790 Basic Queueing Models 27
Return of Erlang
- A call system can be modeled as a M/M/c/c queue
- Calls arrive at a rate of λ calls/second and last X seconds
- Each circuit is view as a server with rate μ = (^) E^1 [X]
- A call is blocked if all the servers (circuits) are busy
λ λ(1-b) λb
1 2
c
...
server
- A new connection increases N by 1, while a release decreases N
- The state of the system has the values 0 , 1 , ..., c
- As with M/M/1, the probability of a call in the next Δt is λΔt
- The blocking probability is when n = c
P r{N (t) = c} = pc =
Ac ∑c^ c! i=
Ai i!
- Which is the Erlang B formula...