Queuing Theory. Long Term Averages. Assumptions. Interesting Values. Queuing Model



Similar documents
Basic Queuing Relationships

Queuing Theory II 2006 Samuel L. Baker

Basic Multiplexing models. Computer Networks - Vassilis Tsaoussidis

Simple Queuing Theory Tools You Can Use in Healthcare

Network Design Performance Evaluation, and Simulation #6

Minimax Strategies. Minimax Strategies. Zero Sum Games. Why Zero Sum Games? An Example. An Example

Chapter 13 Waiting Lines and Queuing Theory Models - Dr. Samir Safi

LECTURE 16. Readings: Section 5.1. Lecture outline. Random processes Definition of the Bernoulli process Basic properties of the Bernoulli process

QUEUING THEORY. 1. Introduction

Process simulation. Enn Õunapuu

4 The M/M/1 queue. 4.1 Time-dependent behaviour

UNIT 2 QUEUING THEORY

Don t Slow Me Down with that Calculator Cliff Petrak (Teacher Emeritus) Brother Rice H.S. Chicago cpetrak1@hotmail.com

Maths Workshop for Parents 2. Fractions and Algebra

Multiplying Fractions

Waiting Times Chapter 7

Q UEUING ANALYSIS. William Stallings

6.263/16.37: Lectures 5 & 6 Introduction to Queueing Theory


Fundamentals of Probability

Transport Layer Protocols

PURSUITS IN MATHEMATICS often produce elementary functions as solutions that need to be

Numerator Denominator

Solution Guide Chapter 14 Mixing Fractions, Decimals, and Percents Together

Section 1.5 Exponents, Square Roots, and the Order of Operations

CSE3214 Computer Network Protocols and Applications. Chapter 1 Examples and Homework Problems

ISyE 2030 Test 2 Solutions

1. Repetition probability theory and transforms

DATE PERIOD. Estimate the product of a decimal and a whole number by rounding the Estimation

MATH 140 Lab 4: Probability and the Standard Normal Distribution

Session 7 Fractions and Decimals

Part 1 Expressions, Equations, and Inequalities: Simplifying and Solving

Financial Mathematics

Radicals - Rationalize Denominators

Revision Notes Adult Numeracy Level 2

1. The subnet must prevent additional packets from entering the congested region until those already present can be processed.

Summer Assignment for incoming Fairhope Middle School 7 th grade Advanced Math Students

Cumulative Diagrams: An Example

A Policy-Based Admission Control Scheme for Voice over IP Networks

Radicals - Multiply and Divide Radicals

Chapter 6 Congestion Control and Resource Allocation

Rational Expressions - Complex Fractions

Chapter 2. Simulation Examples 2.1. Prof. Dr. Mesut Güneş Ch. 2 Simulation Examples

Solving Rational Equations

A Short Guide to Significant Figures

Waiting Lines and Queuing Theory Models

Analysis of a Production/Inventory System with Multiple Retailers

Simplification of Radical Expressions

Load Balancing and Switch Scheduling

Exponential Approximation of Multi-Skill Call Centers Architecture

Note on growth and growth accounting

Surviving DDoS. SANOG X 5 September ed.lewis@neustar.biz. 5 Sep '07, SANOG X ed.lewis@neustar.biz 1

JobTestPrep's Numeracy Review Decimals & Percentages

ANALYSIS OF THE QUALITY OF SERVICES FOR CHECKOUT OPERATION IN ICA SUPERMARKET USING QUEUING THEORY. Azmat Nafees Liwen Liang. M. Sc.

Basic numerical skills: FRACTIONS, DECIMALS, PROPORTIONS, RATIOS AND PERCENTAGES

CHAPTER 6: Continuous Uniform Distribution: 6.1. Definition: The density function of the continuous random variable X on the interval [A, B] is.

Smart Queue Scheduling for QoS Spring 2001 Final Report

3.3 Addition and Subtraction of Rational Numbers

Probability Calculator

Quantitative Analysis of Cloud-based Streaming Services

SIMPLIFYING ALGEBRAIC FRACTIONS

Final for ECE374 05/06/13 Solution!!

MTAT Business Process Management (BPM) Lecture 6 Quantitative Process Analysis (Queuing & Simulation)

Chapter 1. Introduction

A capacity planning / queueing theory primer or How far can you go on the back of an envelope? Elementary Tutorial CMG 87

Section 1.1 Linear Equations: Slope and Equations of Lines

Negative Exponents and Scientific Notation

TCP over Multi-hop Wireless Networks * Overview of Transmission Control Protocol / Internet Protocol (TCP/IP) Internet Protocol (IP)

Notes on Continuous Random Variables

MATH-0910 Review Concepts (Haugen)

Lesson 7 - The Aggregate Expenditure Model

M/M/1 and M/M/m Queueing Systems

Chapter 1: Order of Operations, Fractions & Percents

3.2. Solving quadratic equations. Introduction. Prerequisites. Learning Outcomes. Learning Style

Question: What is the probability that a five-card poker hand contains a flush, that is, five cards of the same suit?

6.6 Scheduling and Policing Mechanisms

Charlesworth School Year Group Maths Targets

Day One: Least Common Multiple

Chapter 9 Monté Carlo Simulation

INTRUSION PREVENTION AND EXPERT SYSTEMS

Numerical and Algebraic Fractions

This Unit: Floating Point Arithmetic. CIS 371 Computer Organization and Design. Readings. Floating Point (FP) Numbers

Measurements 1. BIRKBECK MATHS SUPPORT In this section we will look at. Helping you practice. Online Quizzes and Videos

Integrals of Rational Functions

RTP / RTCP. Announcements. Today s Lecture. RTP Info RTP (RFC 3550) I. Final Exam study guide online. Signup for project demos

CHAPTER 4 DIMENSIONAL ANALYSIS

CS321. Introduction to Numerical Methods

Math Refresher. Book #2. Workers Opportunities Resources Knowledge

How To Model A System

Fractions. If the top and bottom numbers of a fraction are the same then you have a whole one.

Session 29 Scientific Notation and Laws of Exponents. If you have ever taken a Chemistry class, you may have encountered the following numbers:

Quick Reference ebook

for the Bill Hanlon

WHERE DOES THE 10% CONDITION COME FROM?

Linear Equations and Inequalities

361 Computer Architecture Lecture 14: Cache Memory

Financial Mathematics and Simulation MATH Spring 2011 Homework 2

Lesson 9: Radicals and Conjugates

Transcription:

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. Long Term Averages Queuing theory provides long term average values. It does not predict when the next event will occur. Input data should be measured over an extended period of time. We assume arrival times and service times are random. 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 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. Tq

More Interesting Values Time in the system (Tq) the average time each customer is in the system, both waiting and being serviced. Time waiting (Tw) the average time each customer waits in the queue. Tq = Tw + s 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 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 5% of the time. 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. Exponential Distribution 1.9.8.7.6.5.4.3..1.5 1 1.5.5 3 3.5 4 4.5 5 Poisson Arrival Rate If customers are arriving at the exponentially distributed rate, then the probability that there will be k customers after time t is: P ( t) = k ( t) k! k t e

Math Notes! = 1! = 1 X = 1 Poisson Example A networked printer usually gets 15 print jobs every hour. The printer has to be turned off for 1 minutes for maintenance. What is the probability that nobody will want to use the printer during that time? X 1 = X Poisson Solution A networked printer usually gets 15 print jobs every hour. The printer has to be turned off for 1 minutes for maintenance. What is the probability that nobody will want to use the printer during that time? The arrival rate is 15/6 =.5 jobs/min. (.5*1) P (1) =!.5*1 e =.8 Expected Number of Arrivals If customers are arriving at the exponentially distributed rate, how many customers should you expect to arrive in time t? Expected = * t For the printer problem with an arrival rate =.5, in 1 minutes we should expect.5 jobs to arrive Queuing Models Queuing systems are usually described by three values separated by slashes Arrival distribution / service distribution / # of servers where: M = Markovian or exponentially distributed D = Deterministic or constant. G = General or binomial distribution 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.

Why is there Queuing? The arrivals come at random times. Sometimes arrivals are far apart. Sometimes many customers arrive at almost the same time. When more customers arrive in a short period of time than can be serviced, queues form. If the arrival rate was not random, queues would not be created. Utilization Utilization (represented by the Greek letter rho, ) is the fraction of time the server is busy. Utilization is always between zero and one 1 If a bank teller spends 6 hours out of an 8 hour day counting money, her utilization is 6/8 =.75 Calculating Utilization Utilization can be calculated from the arrival rate and the service time. = * s 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. Little s Formula The number in the system is equal to the arrival rate times the average time a customer spends in the system. Q = * Tq This is also true for just the queue. W = * Tw Tq M/M/1 Formulas s = Q = s Tw = W = 1 1 Application of Little s Formula Multiplying the formulas on the left by gives the formula on the right. s Tq = = = Q

Tq 18 16 14 1 1 8 6 4.1..3.4.5.6.7.8.9 1 Utilization Solution Process 1. Determine what quantities you need to know.. 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 1 ms. The time to complete a request is exponentially distributed. Over a period of 3 minutes, 117, 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 Identify the server The disk drive is the server Identify the queued items Disk requests Identify the queuing model M/M/1 Solution (cont.) Determine the service time S = 1 ms =.1 sec / request Determine the arrival rate = 117, request / (3 min * 6 sec/min) = 65 requests / sec Calculate = *s =.1 sec/request * 65 req/sec =.65 Solution (cont.) Time to complete the average request s.1 T Q = = = 8. 6ms.65 The average length of the queue.65 W = = = 1.1.65

Number in the System The value Q represents the average number of jobs in the system, both waiting and being served. There are not always Q jobs in the system. Sometimes there are more, sometimes less. Q is the average. Queue Size Probabilities The probability that there are exactly N jobs in the system is given by N Prob[ Q = N] = (1 ) Summing the probabilities for individual cases gives the probability of N or less customers in the system i prob[ Q N] = (1 ) N i= Large Queue Probabilities The probability that there are more than N customers in the system is the sum of the probabilities from N-1 to. Remembering that the sum of all probabilities is one, the probability that there are more than N customers in the system is: i prob[ Q > N] = (1 ) N i= Example Continued In the previous example, what is the probability that a request does not get queued? A job can get serviced immediately if there are only zero or one jobs in the system. 1 P[ Q = or1] = (1 ) * + (1 ) * =.35 +.75 =.58 Accuracy and Significant Digits Just because my calculator displays a 1 digit number does not mean the answer is accurate to 1 digits. Your answer can only be as accurate as your input data. If your data has three significant digits, your answer cannot have more than three digits. Always use as much accuracy as possible in these calculations and round off only at the end. Constant Service Time In some systems the service time is always a constant. The M/D/1 model is used for constant service time. There is less randomness in the system. The wait time will be less.

M/D/1 Formulas M/D/1 Example ( ) Tq = s (1 ) s Tw = (1 ) Q = + (1 ) W = (1 ) An ATM network sends 53 byte packets over a 155 Mb/sec line. It always takes.74 ms to send a packet. Each second 145, packets are sent. How long does a packet wait to be sent? M/D/1 Solution Determine what quantities you need to know. The average time spent in the queue, Tw. Identify the server The transmission line. Identify the queued items Packets (not bits or bytes) Identify the queuing model M/D/1 M/D/1 Solution Determine the service time.74x1-6 seconds Determine the arrival rate 145, packets/second Calculate = 145, *.74x1-6 =.3973 Calculate the desired values 6 s.75*1 *.3973 Tw = = = 9.3*1 (1 ) (1.3973) 7 sec Multiple Servers Multiple Servers S S S Customers arrive and join a single queue. Whenever any of the servers is idle, it serves the first customer on the single queue. All of the servers must be identical. Any customer can be served by any server. When there are N servers, the model is M/M/N

Multiple Server Utilization The server utilization for an N server system is: = s / N This is the average utilization for all N servers. Intermediate Value K To make calculations easier, we first compute the value K. K i N 1 ( s) = i! = N i ( s) i= i! i K Calculation The first term (i = ) is always 1 Note that the value in the denominator is equal to the numerator plus the last term. Since the denominator is always larger than the numerator, the value K must always be less than 1. The value K is an intermediate that simplifies calculations. It has no intrinsic meaning. Multiple Servers Busy The probability that all servers are busy is K C = sk N This is the probability that a new customer will have to wait in the queue. M/M/N formulas Example Cs Tq = + s N( ) Cs Tw = N ( ) Q = C + s W = C Assume that you have a printer that can print an average file in two minutes. Every two and a half minutes a user sends another file to the printer. How long does it take before a user can get their output? note: = s / N

Slow Printer Solution Determine what quantities you need to know. How long for job to exit the system, Tq Identify the server The printer Identify the queued items Print job Identify the queuing model M/M/1 Slow Printer Solution Determine the service time Print a file in minutes, s = min Determine the arrival rate new file every.5 minutes. = 1/.5 =.4 Calculate = * s =.4 * =.8 Calculate the desired values Tq = s / (1- ) = / (1 -.8) = 1 min Add a Second Printer To speed things up you can buy another printer that is exactly the same as the one you have. How long will it take for a user to get their files printed if you had two identical printers? K = N 1 i ( s) i= i! N i ( s) i= i! Calculate K 1 ( s) ( s) + =! 1! 1 ( s) ( s) ( s) + +! 1!! All values are the same, except the model is M/M/ and = * s / =.4 K =.84957 Calculate M/M/N Solution K C = sk N =.857 Cs Tq = + s =.57 min N(1 ) Note that with twice as many printers this example runs about 4X as fast. Faster Printer Another solution is to replace the existing printer with one that can print a file in an average of one minute. How long does it take for a user to get their output with the faster printer? M/M/1 queue with =.4 and s = 1. Tq = s / (1- ) = 1 / (1 -.4) = 1.67 min A single fast printer is better, particularly at low utilization. 6X better than slow printer.

Multiple Arrival Streams Exponentially distributed arrival streams can be merged. The total arrival rate is the sum of the individual arrival rates. a b a + b Dividing Customer Streams An exponentially distributed arrival stream can be divided. The sum of the separated arrival rates must equal to original arrival rate. / / Linking Multiple Queues The exit rate of a system is equal to the arrival rate. The output from one queuing system can feed into another. The time through the system is the sum of the time through each queuing component. Multiple Queue Example Consider a network with a computer connected to a router which is connected to a server. The computer can send a packet in 1 ms while the router can send it to the server in 7 ms. Programs on the computer generate 4 packets/second. The router receives a total of 1 packets/second. How long does it take for a packet to get to the server? 4 pkt/sec 1 pkt/sec Computer Router Server 1 ms 7 ms Multiple Queue Solution Determine what quantities you need to know Sum of Tq for both networks Identify the servers The computer transmitter and the router Identify the queued items Packets Identify the queuing model both M/M/1 queues Multiple Queue Solution Determine the service time 1ms for the computer, 7 ms for the router Determine the arrival rate 4 pkt/sec for computer, 1 pkt/sec for router Calculate computer= 4*.1 =.48 router=1*.7 =.7 Calculate the desired values Tqcomputer =.1/(1-.48) =.31 sec Tqrouter=.7/(1-.7) =.33 sec Total=46.4ms

Reusing a Server Consider a file server. Requests use the network to get to the server, then use the disk, then the network again to get back. The load on the network is doubled. Net Disk