CS433 Modeling and Simulation Lecture 13 Queueing Theory Dr. Anis Koubâa 03 May 2009 Al-Imam Mohammad Ibn Saud University
Goals for Today Lean the most important queuing models Single Queue: M/M/1 Multiple Queues: M/M/m Multiple Servers: M/M/m/m
M/M/1 Queue 3 Poisson Arrivals, exponentially distributed service times, 1 server and infinite capacity buffer
M/M/1 Example M/M/1 Queue Poisson Arrivals (rate ), exponentially distributed service times (rate ), one server, infinite capacity buffer. λ 01 μ λ 2 μ λ j-1 μ λ j μ μ λ λ μ Queue Server λ μ Click for Queue Simulator Queue Load
M/M/1 queue model 5 E[W] E[S] Xs E[X]
M/M/1 Queue: Steady State λ 01 μ λ 2 μ λ j-1 μ λ j μ μ λ λ μ Using the birth-death result λ j = λ and μ j = μ, we obtain Therefore for λ / μ = ρ <1 Probability that the Queue in Empty
M/M/1 Performance Metrics Server Utilization Throughput Expected Queue Length
M/M/1 Performance Metrics Average System Time Average waiting time in queue
Response Time vs. Arrivals 9
Stable Region CS352 Fall, linear region
M/M/1 Performance Metrics Examples μ=0.5 Ε[Χ]Ε[Χ] Ε[W]Ε[W] Ε[S]Ε[S]
PASTA Property PASTA: Poisson Arrivals See Time Averages Let π j (t)= Pr{ System state X(t)= j } Let a j (t)= Pr{ Arriving customer at t finds X(t)= j } In general π j (t) ≠ a j (t)! Suppose a D/D/1 system with interarrival times equal to 1 and service times equal to aaaa Thus π 0 (t)= 0.5 and π 1 (t)= 0.5 while a 0 (t)= 1 and a 1 (t)= 0!
Theorem For a queueing system, when the arrival process is Poisson and independent of the service process then, the probability that an arriving customer finds j customers in the system is equal to the probability that the system is at state j. In other words, Proof: Arrival occurs in interval (t, Δ t)
M/M/m Queue 14 Poisson Arrivals, exponentially distributed service times, m identical servers and infinite capacity buffer
M/M/m Queueing System Meaning: Poisson Arrivals, exponentially distributed service times, m identical servers and infinite capacity buffer. λ 01 μ λ 2 2μ2μ λ m mμmμ λ m+1 mμmμ 3μ3μ λ λ mμmμ 1 m …
M/M/m Queueing System Using the general birth-death result Letting ρ=λ/(mμ) we get To find π 0
M/M/m Performance Metrics Server Utilization
M/M/m Performance Metrics Throughput Expected Number of Customers in the System Using Little’s Law, the average response time Average Waiting time in queue
M/M/m Performance Metrics Queueing Probability Erlang C Formula
Example Suppose that customers arrive according to a Poisson process with rate λ=1. You are given the following two options, Install a single server with processing capacity μ 1 = 1.5 Install two identical servers with processing capacity μ 2 = 0.75 and μ 3 = 0.75 Split the incoming traffic to two queues each with probability 0.5 and have μ 2 = 0.75 and μ 3 = 0.75 serve each queue. μ1μ1 λ Α μ2μ2 μ3μ3 λ Β μ2μ2 μ3μ3 λ C
Example Throughput It is easy to see that all three systems have the same throughput E[R A ]= E[R B ]= E[R C ]=λ Server Utilization Therefore, each server is 2/3 utilized Therefore, all servers are similarly loaded.
Example Probability of being idle For each server
Example Queue length and delay For each queue!
End of Chapter 24
M/M/∞ Queue 25
M/M/ ∞ Queueing System Special case of the M/M/m system with m going to ∞ λλ λ λ 01 μ 2 2μ2μ λ m mμmμ m+1 (m+1)μ 3μ3μ λ Let ρ=λ/μ then, the state probabilities are given by System Utilization and Throughput
M/M/ ∞ Performance Metrics Expected Number in the System Using Little’s Law No queueing! Number of busy servers
M/M/1/K – Finite Buffer Capacity Meaning: Poisson Arrivals, exponentially distributed service times, one server and finite capacity buffer K. Using the birth-death result λ j =λ and μ j =μ, we obtain Therefore for λ/μ = ρ λ 01 μ λ 2 μ λ K-1 μ λ K μ μ λ
M/M/1/K Performance Metrics Server Utilization Throughput Blocking Probability Probability that an arriving customer finds the queue full (at state K )
M/M/1/K Performance Metrics Expected Queue Length System time Net arrival rate (no losses)
M/M/m/m – Queueing System Meaning: Poisson Arrivals, exponentially distributed service times, m servers and no storage capacity. Using the birth-death result λ j =λ and μ j =μ, we obtain Therefore for λ/μ = ρ λ 01 μ λ 2 2μ2μ λ m-1 (m-1)μ λ m mμmμ 3μ3μ λ
M/M/m/m Performance Metrics Throughput Blocking Probability Probability that an arriving customer finds all servers busy (at state m ) Erlang B Formula
M/M/1//N – Closed Queueing System Meaning: Poisson Arrivals, exponentially distributed service times, one server and the number of customers are fixed to N. NλNλ 01 μ (N-1)λ 2 μ 2λ2λ N-1 μ λ N μ μ (N-2)λ λ μ 1 N … Using the birth-death result, we obtain
M/M/1//N – Closed Queueing System Response Time Time from the moment the customer entered the queue until it received service. NλNλ 01 μ (N-1)λ 2 μ 2λ2λ N-1 μ λ N μ μ (N-2)λ For the queue, using Little’s law we get, In the “thinking” part, Therefore