CS352 - Introduction to Queuing Theory Rutgers University
CS352 Fall,20052 Queuing theory definitions (Bose) “the basic phenomenon of queueing arises whenever a shared facility needs to be accessed for service by a large number of jobs or customers.” (Wolff) “The primary tool for studying these problems [of congestions] is known as queueing theory.” (Kleinrock) “We study the phenomena of standing, waiting, and serving, and we call this study Queueing Theory." "Any system in which arrivals place demands upon a finite capacity resource may be termed a queueing system.” (Mathworld) “The study of the waiting times, lengths, and other properties of queues.”
CS352 Fall,20053 Applications of Queuing Theory Telecommunications Traffic control Determining the sequence of computer operations Predicting computer performance Health services (eg. control of hospital bed assignments) Airport traffic, airline ticket sales Layout of manufacturing systems.
CS352 Fall,20054 Example application of queuing theory In many retail stores and banks multiple line/multiple checkout system a queuing system where customers wait for the next available cashier We can prove using queuing theory that : throughput improves increases when queues are used instead of separate lines
CS352 Fall,20055 Example application of queuing theory
CS352 Fall,20056 Queuing theory for studying networks View network as collections of queues FIFO data-structures Queuing theory provides probabilistic analysis of these queues Examples: Average length Average waiting time Probability queue is at a certain length Probability a packet will be lost
CS352 Fall,20057 Little’s Law Little’s Law: Mean number tasks in system = mean arrival rate x mean response time Observed before, Little was first to prove Applies to any system in equilibrium, as long as nothing in black box is creating or destroying tasks ArrivalsDepartures System
CS352 Fall,20058 Proving Little’s Law J = Shaded area = 9 Same in all cases! Packet # Time # in System Time Time in System Packet # Arrivals Departures
CS352 Fall,20059 Definitions J: “Area” from previous slide N: Number of jobs (packets) T: Total time : Average arrival rate N/T W: Average time job is in the system = J/N L: Average number of jobs in the system = J/T
CS352 Fall, # in System (L) Proof: Method 1: Definition Time (T) Time in System (W) Packet # (N) =
CS352 Fall, Proof: Method 2: Substitution Tautology
CS352 Fall, Model Queuing System Server System Queuing System Queue Server Queuing System Use Queuing models to Describe the behavior of queuing systems Evaluate system performance
CS352 Fall, Characteristics of queuing systems Arrival Process The distribution that determines how the tasks arrives in the system. Service Process The distribution that determines the task processing time Number of Servers Total number of servers available to process the tasks
CS352 Fall, Kendall Notation 1/2/3(/4/5/6) Six parameters in shorthand First three typically used, unless specified 1. Arrival Distribution 2. Service Distribution 3. Number of servers 4. Total Capacity (infinite if not specified) 5. Population Size (infinite) 6. Service Discipline (FCFS/FIFO)
CS352 Fall, Distributions M: stands for "Markovian", implying exponential distribution for service times or inter-arrival times. D: Deterministic (e.g. fixed constant) E k : Erlang with parameter k H k : Hyperexponential with param. k G: General (anything)
CS352 Fall, Kendall Notation Examples M/M/1: Poisson arrivals and exponential service, 1 server, infinite capacity and population, FCFS (FIFO) the simplest ‘realistic’ queue M/M/m Same, but M servers G/G/3/20/1500/SPF General arrival and service distributions, 3 servers, 17 queue slots (20-3), 1500 total jobs, Shortest Packet First
CS352 Fall, Poisson Process For a poisson process with average arrival rate, the probability of seeing n arrivals in time interval delta t
CS352 Fall, Poisson process & exponential distribution Inter-arrival time t (time between arrivals) in a Poisson process follows exponential distribution with parameter
CS352 Fall, Analysis of M/M/1 queue Given: : Arrival rate of jobs (packets on input link) : Service rate of the server (output link) Solve: L: average number in queuing system L q average number in the queue W: average waiting time in whole system W q average waiting time in the queue
CS352 Fall, M/M/1 queue model WqWq W L LqLq
CS352 Fall, Solving queuing systems 4 unknowns: L, L q W, W q Relationships: L= W L q = Wq (steady-state argument) W = W q + (1/ ) If we know any 1, can find the others Finding L is hard or easy depending on the type of system. In general:
CS352 Fall, Analysis of M/M/1 queue Goal: A closed form expression of the probability of the number of jobs in the queue (P i ) given only and
CS352 Fall, Equilibrium conditions n+1nn-1 Define to be the probability of having n tasks in the system at time t
CS352 Fall, Equilibrium conditions n+1nn-1
CS352 Fall, Solving for P 0 and P n Step 1 Step 2
CS352 Fall, Solving for P 0 and P n Step 3 Step 4
CS352 Fall, Solving for L
CS352 Fall, Solving W, W q and L q
CS352 Fall, Online M/M/1 animation eueing/mm1_q/mm1_q.html
CS352 Fall, Response Time vs. Arrivals
CS352 Fall, Stable Region linear region
CS352 Fall, Example On a network gateway, measurements show that the packets arrive at a mean rate of 125 packets per second (pps) and the gateway takes about 2 millisecs to forward them. Assuming an M/M/1 model, what is the probability of buffer overflow if the gateway had only 13 buffers. How many buffers are needed to keep packet loss below one packet per million?
CS352 Fall, Example Measurement of a network gateway: mean arrival rate (l): 125 Packets/s mean response time (m): 2 ms Assuming exponential arrivals: What is the gateway’s utilization? What is the probability of n packets in the gateway? mean number of packets in the gateway? The number of buffers so P(overflow) is <10 -6 ?
CS352 Fall, Example Arrival rate λ = Service rate μ = Gateway utilization ρ = λ/μ = Prob. of n packets in gateway = Mean number of packets in gateway =
CS352 Fall, Example Arrival rate λ = 125 pps Service rate μ = 1/0.002 = 500 pps Gateway utilization ρ = λ/μ = 0.25 Prob. of n packets in gateway = Mean number of packets in gateway =
CS352 Fall, Example Probability of buffer overflow: To limit the probability of loss to less than :
CS352 Fall, Example Probability of buffer overflow: = P(more than 13 packets in gateway) To limit the probability of loss to less than :
CS352 Fall, Example Probability of buffer overflow: = P(more than 13 packets in gateway) = ρ 13 = = 1.49x10 -8 = 15 packets per billion packets To limit the probability of loss to less than :
CS352 Fall, Example Probability of buffer overflow: = P(more than 13 packets in gateway) = ρ 13 = = 1.49x10 -8 = 15 packets per billion packets To limit the probability of loss to less than :
CS352 Fall, Example To limit the probability of loss to less than : or
CS352 Fall, Example To limit the probability of loss to less than : or = 9.96
CS352 Fall, Empirical Example M/M/m system