Queuing Theory
Queuing Theory
Queuing Theory
Queuing theory is the mathematics of waiting lines. It is extremely useful in predicting and evaluating system performance. Queuing theory has been used for operations research. Traditional queuing theory problems refer to customers visiting a store, analogous to requests arriving at a device.
Assumptions
Independent arrivals Exponential distributions Customers do not leave or change queues. Large queues do not discourage customers. Many assumptions are not always true, but queuing theory gives good results anyway
Queuing Model
Q W Tw
Tq
S
Interesting Values
Arrival rate () the average rate at which customers arrive. Service time (s) the average time required to service one customer. Number waiting (W) the average number of customers waiting. Number in the system (Q) the average total number of customers in the system.
Arrival Rate
The arrival rate, , is the average rate new customers arrive measured in arrivals per time period. Common units are access/second The inter-arrival time, a, is the average time between customer arrivals. It is measured in time per customer. A common unit would be seconds/access.
a=1/
Random Values
We assume that most of the events we are interested in occur randomly.
Time of a request to a device Time to service a request Time user makes a request
Exponential Distribution
Many of the random values are exponentially distributed. Frequency of Occurrence = e-t There are many small values and a few large values. The inter-arrival time of customers is naturally exponentially distributed.
Although events are random, we may know the average value of the times and their distribution. If you flip a coin, you will get heads 50% of the time.
Exponential Distribution
1 0.9 0.8 0.7 0.6 0.5 0.4 0.3 0.2 0.1 0 0 0.5 1 1.5 2 2.5 3 3.5 4 4.5 5
(t ) k t Pk (t ) = e k!
Math Notes
Poisson Example
A networked printer usually gets 15 print jobs every hour. The printer has to be turned off for 10 minutes for maintenance. What is the probability that nobody will want to use the printer during that time?
0! = 1! = 1 X0 = 1 X1 = X
Poisson Solution
A networked printer usually gets 15 print jobs every hour. The printer has to be turned off for 10 minutes for maintenance. What is the probability that nobody will want to use the printer during that time? The arrival rate is 15/60 = 0.25 jobs/min.
Expected = * t
For the printer problem with an arrival rate = 0.25, in 10 minutes we should expect 2.5 jobs to arrive
P0 (10) =
Queuing Models
Queuing systems are usually described by three values separated by slashes
Arrival distribution / service distribution / # of servers
Common Models
The simplest queuing model is M/M/1 where both the arrival time and service time are exponentially distributed. The M/D/1 model has exponentially distributed arrival times but fixed service time. The M/M/n model has multiple servers.
Utilization
Utilization (represented by the Greek letter rho, ) is the fraction of time the server is busy. Utilization is always between zero and one
01
If a bank teller spends 6 hours out of an 8 hour day counting money, her utilization is 6/8 = 0.75
Calculating Utilization
Utilization can be calculated from the arrival rate and the service time.
Littles Formula
The number in the system is equal to the arrival rate times the average time a customer spends in the system.
= *s
Q = * Tq
This is also true for just the queue.
It is important that the units of both the arrival rate and the service time be identical. It may be necessary to convert these values to common units.
W = * Tw
M/M/1 Formulas
s Tq = 1
Tw = s 1
Q=
W=
Tq =
s = =Q 1 1
20 18 16 14 12 Tq 10 8 6 4 2 0 0 0.1 0.2 0.3 0.4 0.5 Utilization 0.6 0.7 0.8 0.9 1
Solution Process
1. Determine what quantities you need to know. 2. Identify the server 3. Identify the queued items 4. Identify the queuing model 5. Determine the service time 6. Determine the arrival rate 7. Calculate 8. Calculate the desired values
Example
Consider a disk drive that can complete an average request in 10 ms. The time to complete a request is exponentially distributed. Over a period of 30 minutes, 117,000 requests were made to the disk. How long did it take to complete the average request? What is the average number of queued requests?
Solution
Determine what quantities you need to know.
The average request time is Tq The number of queued jobs is W
Solution (cont.)
Determine the service time