340 likes | 353 Views
Al-Imam Mohammad Ibn Saud University. CS433 Modeling and Simulation Lecture 13 Queueing Theory. Dr. Anis Koubâa. 03 May 2009. 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.
E N D
Al-Imam Mohammad Ibn Saud University CS433Modeling and SimulationLecture 13Queueing Theory Dr. Anis Koubâa 03 May 2009
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 Poisson Arrivals, exponentially distributed service times, 1 server and infinite capacity buffer
λ λ λ λ λ λ j-1 j 0 1 2 μ μ μ μ μ μ Queue Server M/M/1 Example Click for Queue Simulator λ • Queue Load μ • M/M/1 Queue • Poisson Arrivals (rate l), • exponentially distributed service times (rate m), • one server, • infinite capacity buffer.
Xs E[X] l m E[W] E[S] M/M/1 queue model
λ λ λ λ λ λ j-1 j 0 1 2 μ μ μ μ μ μ M/M/1 Queue: Steady State • Using the birth-death resultλj=λ andμj=μ, we obtain Probability that the Queue in Empty • Therefore for λ/μ = ρ <1
M/M/1 Performance Metrics • Server Utilization • Throughput • Expected Queue Length
M/M/1 Performance Metrics • Average System Time • Average waiting time in queue
Stable Region linear region
M/M/1 Performance Metrics Examples • μ=0.5 Ε[S] Ε[W] Ε[Χ]
a a a a 0 0.5 1.0 1.5 2.0 2.5 3.0 PASTA Property • PASTA: Poisson Arrivals See Time Averages • Let πj(t)= Pr{ System state X(t)= j } • Let aj(t)= Pr{ Arriving customer at t finds X(t)= j } • In general πj(t) ≠aj(t)! • Suppose a D/D/1 system with interarrival times equal to 1 and service times equal to 0.5 • Thus π0(t)= 0.5 and π1(t)= 0.5 while a0(t)= 1 and a1(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 Poisson Arrivals, exponentially distributed service times, midentical servers and infinite capacity buffer
λ λ λ λ λ λ m m+1 0 1 2 mμ 3μ mμ mμ μ 2μ 1 … m M/M/m Queueing System • Meaning: Poisson Arrivals, exponentially distributed service times, midentical servers and infinite capacity buffer.
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
μ2 λ μ1 μ2 λ Β μ3 Α μ3 λ C 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.75and μ3= 0.75 • Split the incoming traffic to two queues each with probability 0.5 and have μ2= 0.75and μ3= 0.75serve each queue.
Example • Throughput • It is easy to see that all three systems have the same throughput E[RA]= E[RB]= E[RC]=λ • 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!
λ λ λ λ λ λ m m+1 0 1 2 3μ mμ (m+1)μ μ 2μ M/M/∞ Queueing System • Special case of the M/M/m system with m going to ∞ • Let ρ=λ/μthen, the state probabilities are given by • System Utilization and Throughput
M/M/∞ Performance Metrics • Expected Number in the System Number of busy servers • Using Little’s Law No queueing!
λ λ λ λ λ K-1 K 0 1 2 μ μ μ μ μ 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 λ/μ = ρ
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 Net arrival rate (no losses) • System time
λ λ λ λ λ m-1 m 0 1 2 3μ (m-1)μ mμ μ 2μ 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 λ/μ = ρ
M/M/m/m Performance Metrics • Blocking Probability Erlang B Formula Probability that an arriving customer finds all servers busy (at state m) • Throughput
λ Nλ (N-1)λ (N-2)λ 2λ 1 μ N-1 N 0 1 2 μ μ μ μ μ … λ N 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. • Using the birth-death result, we obtain
λ Nλ (N-1)λ (N-2)λ 2λ N-1 N 0 1 2 μ μ μ μ μ M/M/1//N – Closed Queueing System • Response Time • Time from the moment the customer entered the queue until it received service. • For the queue, using Little’s law we get, • In the “thinking” part, • Therefore