Introduction to queuing theory

Similar documents
Performance Evaluation of Queuing Systems

Queuing Theory. Using the Math. Management Science

Queueing Theory. VK Room: M Last updated: October 17, 2013.

Queueing Theory I Summary! Little s Law! Queueing System Notation! Stationary Analysis of Elementary Queueing Systems " M/M/1 " M/M/m " M/M/1/K "

Performance Modelling of Computer Systems

CDA5530: Performance Models of Computers and Networks. Chapter 4: Elementary Queuing Theory

Networking = Plumbing. Queueing Analysis: I. Last Lecture. Lecture Outline. Jeremiah Deng. 29 July 2013

BIRTH DEATH PROCESSES AND QUEUEING SYSTEMS

λ, µ, ρ, A n, W n, L(t), L, L Q, w, w Q etc. These

Review of Queuing Models

λ λ λ In-class problems

Figure 10.1: Recording when the event E occurs

Computer Systems Modelling

Data analysis and stochastic modeling

CPSC 531: System Modeling and Simulation. Carey Williamson Department of Computer Science University of Calgary Fall 2017

Link Models for Circuit Switching

Introduction to Markov Chains, Queuing Theory, and Network Performance

Link Models for Packet Switching

Queuing Theory. Richard Lockhart. Simon Fraser University. STAT 870 Summer 2011

Computer Networks More general queuing systems

QUEUING SYSTEM. Yetunde Folajimi, PhD

Queuing Networks: Burke s Theorem, Kleinrock s Approximation, and Jackson s Theorem. Wade Trappe

IEOR 6711, HMWK 5, Professor Sigman

CS418 Operating Systems

Continuous-Time Markov Chain

Introduction to Queueing Theory

Continuous Time Processes

Queueing systems. Renato Lo Cigno. Simulation and Performance Evaluation Queueing systems - Renato Lo Cigno 1

Lecture 7: Simulation of Markov Processes. Pasi Lassila Department of Communications and Networking

Introduction to Queueing Theory

UNIVERSITY OF YORK. MSc Examinations 2004 MATHEMATICS Networks. Time Allowed: 3 hours.

reversed chain is ergodic and has the same equilibrium probabilities (check that π j =

Waiting Line Models: Queuing Theory Basics. Metodos Cuantitativos M. En C. Eduardo Bustos Farias 1

M/G/1 and M/G/1/K systems

Queueing Review. Christos Alexopoulos and Dave Goldsman 10/6/16. (mostly from BCNN) Georgia Institute of Technology, Atlanta, GA, USA

GI/M/1 and GI/M/m queuing systems

Computer Systems Modelling

Chapter 8 Queuing Theory Roanna Gee. W = average number of time a customer spends in the system.

Queueing Review. Christos Alexopoulos and Dave Goldsman 10/25/17. (mostly from BCNN) Georgia Institute of Technology, Atlanta, GA, USA

Kendall notation. PASTA theorem Basics of M/M/1 queue

Non Markovian Queues (contd.)

P (L d k = n). P (L(t) = n),

IEOR 6711: Stochastic Models I, Fall 2003, Professor Whitt. Solutions to Final Exam: Thursday, December 18.

Systems Simulation Chapter 6: Queuing Models

Základy teorie front

Lecture 20: Reversible Processes and Queues

Statistics 150: Spring 2007

PBW 654 Applied Statistics - I Urban Operations Research

Probability and Statistics Concepts

All models are wrong / inaccurate, but some are useful. George Box (Wikipedia). wkc/course/part2.pdf

Chapter 10. Queuing Systems. D (Queuing Theory) Queuing theory is the branch of operations research concerned with waiting lines.

Queueing. Chapter Continuous Time Markov Chains 2 CHAPTER 5. QUEUEING

YORK UNIVERSITY FACULTY OF ARTS DEPARTMENT OF MATHEMATICS AND STATISTICS MATH , YEAR APPLIED OPTIMIZATION (TEST #4 ) (SOLUTIONS)

Chapter 3 Balance equations, birth-death processes, continuous Markov Chains

Outline. Finite source queue M/M/c//K Queues with impatience (balking, reneging, jockeying, retrial) Transient behavior Advanced Queue.

Introduction to Queuing Theory. Mathematical Modelling

Classification of Queuing Models

CS 798: Homework Assignment 3 (Queueing Theory)

Advanced Computer Networks Lecture 3. Models of Queuing

Homework 1 - SOLUTION

5/15/18. Operations Research: An Introduction Hamdy A. Taha. Copyright 2011, 2007 by Pearson Education, Inc. All rights reserved.

Introduction to Queueing Theory

Queuing Theory. 3. Birth-Death Process. Law of Motion Flow balance equations Steady-state probabilities: , if

Chapter 5. Continuous-Time Markov Chains. Prof. Shun-Ren Yang Department of Computer Science, National Tsing Hua University, Taiwan

Part II: continuous time Markov chain (CTMC)

1 IEOR 4701: Continuous-Time Markov Chains

Time Reversibility and Burke s Theorem

Introduction to queuing theory

LECTURE #6 BIRTH-DEATH PROCESS

Chapter 5: Special Types of Queuing Models

6 Solving Queueing Models

NANYANG TECHNOLOGICAL UNIVERSITY SEMESTER I EXAMINATION MH4702/MAS446/MTH437 Probabilistic Methods in OR

Since D has an exponential distribution, E[D] = 0.09 years. Since {A(t) : t 0} is a Poisson process with rate λ = 10, 000, A(0.

Part I Stochastic variables and Markov chains

Readings: Finish Section 5.2

Solutions to Homework Discrete Stochastic Processes MIT, Spring 2011

Continuous Time Markov Chains

Queuing Analysis. Chapter Copyright 2010 Pearson Education, Inc. Publishing as Prentice Hall

Analysis of A Single Queue

EE 368. Weeks 3 (Notes)

2905 Queueing Theory and Simulation PART IV: SIMULATION

Chapter 2 Queueing Theory and Simulation

IOE 202: lectures 11 and 12 outline

Queueing Theory (Part 4)

Queueing Theory II. Summary. ! M/M/1 Output process. ! Networks of Queue! Method of Stages. ! General Distributions

Queues and Queueing Networks

Chapter 1. Introduction. 1.1 Stochastic process

QUEUING MODELS AND MARKOV PROCESSES

Advanced Queueing Theory

Quiz Queue II. III. ( ) ( ) =1.3333

Queuing Theory. Queuing Theory. Fatih Cavdur April 27, 2015

Exercises Stochastic Performance Modelling. Hamilton Institute, Summer 2010

TCOM 501: Networking Theory & Fundamentals. Lecture 6 February 19, 2003 Prof. Yannis A. Korilis

NICTA Short Course. Network Analysis. Vijay Sivaraman. Day 1 Queueing Systems and Markov Chains. Network Analysis, 2008s2 1-1

Class 11 Non-Parametric Models of a Service System; GI/GI/1, GI/GI/n: Exact & Approximate Analysis.

Lecture Notes of Communication Network I y: part 5. Lijun Qian. Rutgers The State University of New Jersey. 94 Brett Road. Piscataway, NJ

The exponential distribution and the Poisson process

Queueing Systems: Lecture 3. Amedeo R. Odoni October 18, Announcements

57:022 Principles of Design II Final Exam Solutions - Spring 1997

Simple queueing models

Transcription:

Introduction to queuing theory Queu(e)ing theory Queu(e)ing theory is the branch of mathematics devoted to how objects (packets in a network, people in a bank, processes in a CPU etc etc) join and leave queues. Queuing is the traditional British spelling but now queueing is probably more common. The first papers about queuing theory were published by Erlang who was studying the Danish telephone system. Queuing theory involves the study of Markov chains. Strictly we would use continuous time Markov chains but here we will approximate with discrete time Markov chains.

Little s theorem Little s theorem Let N be the average number of customers in a queue. Let λ be the average rate of arrivals. Let T be the average time spent queuing. Then we have N = λt. In fact this simple theorem hides much complexity. It is only true under certain conditions.

Little s theorem illustration 8 7 6 5 arrivals α(τ) departures β(τ) 4 3 2 1 T (1) α(τ) T (2) β(τ) N(τ) time τ t 1 t 2 t 3 t 4 t 5 t 6 t 7 t 8

Little s theorem requirements 8 arrivals α(τ) departures β(τ) 7 6 5 4 3 2 1 T (1) α(τ) T (2) β(τ) N(τ) time τ t1 t2 t3 t4 t5 t6 t7 t8 1 The limit λ = lim t α(t)/t exists 2 The limit δ = lim t β(t)/t exists α(t) 3 The limit T = lim t i=1 4 δ = λ T (i) α(t) exists

Little s theorem example You are building a website and want to know how big a server you need. You believe your website will attract 24,000 visitors a day 1,000 visitors an hour. You believe the average visitor will spend 6 minutes on the website. How many visitors does your server need to cope with?

Little s theorem example You are building a website and want to know how big a server you need. You believe your website will attract 24,000 visitors a day 1,000 visitors an hour. You believe the average visitor will spend 6 minutes on the website. How many visitors does your server need to cope with? λ = 1,000 per hour, T = 0.1 hours.

Little s theorem example You are building a website and want to know how big a server you need. You believe your website will attract 24,000 visitors a day 1,000 visitors an hour. You believe the average visitor will spend 6 minutes on the website. How many visitors does your server need to cope with? λ = 1,000 per hour, T = 0.1 hours. From N = λt, N = 100, the average number of visitors at a time is 100.

Little s theorem example You are building a website and want to know how big a server you need. You believe your website will attract 24,000 visitors a day 1,000 visitors an hour. You believe the average visitor will spend 6 minutes on the website. How many visitors does your server need to cope with? λ = 1,000 per hour, T = 0.1 hours. From N = λt, N = 100, the average number of visitors at a time is 100. But because arrival is in peaks better plan for a peak hour.

Queuing theory notation Queuing theory uses a particular notation (Kendall s notation) to describe a queuing system. The arrival process describes the distribution of the interarrival times. M memoryless (Exponential) a Poisson process. D deterministic equally spaced. G general (no specific distribution). Also Ph (phase), EK (Erlangian) The service time distribution determines how long it will take to process an item in the queue. The number of servers describes how many servers deal with the queue. For example M/D/1 is a Poisson input to a single queue which processes in constant time.

The Birth-Death process The Birth Death process The birth death process is a queue with a population which increases or decreases with rates which depend only on k the population at the time. Many queues can be modelled this way. Think of it as a queue state 0 has no people. Arrivals are a Poisson process, rate λ 0. State k has births (arrivals) at rate λ k but deaths (departures) at rate µ k.

Starting the Birth Death process Here we can see the arrivals and departures as a Markov chain. The state represents the number of people in the queue. An M/M/1 system would be modelled by λ k = λ for all k and µ k = µ for all k. Strictly speaking we should model this as a continuous time Markov chain. Here we pretend that µ k and λ k are the arrival probabilities in some small δt so small that 1 µ k λ k > 0.

Birth Death process Transition matrix P = 1 λ 0 λ 0 0 0... µ 1 1 (λ 1 + µ 1 ) λ 1 0... 0 µ 2 1 (λ 2 + µ 2 ) λ 2... 0 0 µ 3 1 (λ 3 + µ 3 )..........

Birth Death process Balance equations Balance equation for state 0 π 0 = µ 1 π 1 + (1 λ 0 )π 0 and for state k with k > 0 π k = λ k 1 π k 1 + µ k+1 π k+1 + (1 λ k µ k )π k.

Birth Death process Balance equations Balance equation for state 0 π 0 = µ 1 π 1 + (1 λ 0 )π 0 and for state k with k > 0 π k = λ k 1 π k 1 + µ k+1 π k+1 + (1 λ k µ k )π k. Rearrange to get: π 1 = λ 0 π 0 /µ 1.

Birth Death process Balance equations Balance equation for state 0 π 0 = µ 1 π 1 + (1 λ 0 )π 0 and for state k with k > 0 π k = λ k 1 π k 1 + µ k+1 π k+1 + (1 λ k µ k )π k. Rearrange to get: π 1 = λ 0 π 0 /µ 1. For state 1 λ 0 π 0 + µ 2 π 2 = λ 1 π 1 + µ 1 π 1,

Birth Death process Balance equations Balance equation for state 0 π 0 = µ 1 π 1 + (1 λ 0 )π 0 and for state k with k > 0 π k = λ k 1 π k 1 + µ k+1 π k+1 + (1 λ k µ k )π k. Rearrange to get: π 1 = λ 0 π 0 /µ 1. For state 1 λ 0 π 0 + µ 2 π 2 = λ 1 π 1 + µ 1 π 1, Rearrange to get: π 2 = λ 1λ 0 π 0 µ 2 µ 1.

Birth Death process Balance equations We have: π 1 = λ 0 π 0 /µ 1. π 2 = λ 1λ 0 π 0 µ 2 µ 1.

Birth Death process Balance equations We have: Can show that in general: π 1 = λ 0 π 0 /µ 1. π 2 = λ 1λ 0 π 0 µ 2 µ 1. π k = π 0 k i=1 λ i 1 µ i.

Birth Death process Balance equations Given π k = π k λ i 1 0 i=1 µ i. now solve with k π k = 1. This is complicated, the full solution is given in the notes.

Birth Death process Balance equations Given π k = π k λ i 1 0 i=1 µ i. now solve with k π k = 1. This is complicated, the full solution is given in the notes. π 0 = 1 1 + k=1 k i=1. λ i 1 µ i

Birth Death process Balance equations Given π k = π k λ i 1 0 i=1 µ i. now solve with k π k = 1. This is complicated, the full solution is given in the notes. π 0 = 1 1 + k=1 k i=1. λ i 1 µ i This may not seem to help much but we also have an equation for π k in terms of π 0. Given µ k and λ k all the π k can be worked out and hence the average queue length. To get further and finally solve M/M/1 we need the concept of utilisation.

Utilisation Utilisation Utilisation (utilization if you are American) ρ is given by the equation ρ = λ µ, where λ is the mean arrival rate and µ is the maximum possible service rate of the system (when all servers are working). Utilisation is a good measure of the fullness of the system. A system at low utilisation is likely to be empty much of the time. Utilisation can also be thought of as the proportion of time the system is busy.

Solving the M/M/1 Finally we are ready to solve M/M/1 Substituting in π k = k λ i 1 i=1 µ i π 0 = ρ k π 0.

Solving the M/M/1 Finally we are ready to solve M/M/1 Substituting in π k = k λ i 1 i=1 µ i π 0 = ρ k π 0. 1 Also π 0 = 1+ 1 = k=1 ρk 1+ρ/(1 ρ) = 1 ρ.

Solving the M/M/1 Finally we are ready to solve M/M/1 Substituting in π k = k λ i 1 i=1 µ i π 0 = ρ k π 0. 1 Also π 0 = 1+ 1 = k=1 ρk 1+ρ/(1 ρ) = 1 ρ. Hence for M/M/1 π k = ρ k (1 ρ). The mean queue length is E[Q] = k=1 kπ k = k=1 ρk (1 ρ). A neat trick gives us the answer.

A neat trick to solve M/M/1 expected queue E[Q] = i=0 i(1 ρ)ρi

A neat trick to solve M/M/1 expected queue E[Q] = i=0 i(1 ρ)ρi E[Q] = (1 ρ)ρ i=0 iρi 1

A neat trick to solve M/M/1 expected queue E[Q] = i=0 i(1 ρ)ρi E[Q] = (1 ρ)ρ i=0 iρi 1 E[Q] = (1 ρ)ρ i=0 dρ i dρ

A neat trick to solve M/M/1 expected queue E[Q] = i=0 i(1 ρ)ρi E[Q] = (1 ρ)ρ i=0 iρi 1 E[Q] = (1 ρ)ρ dρ i i=0 dρ E[Q] = (1 ρ)ρ d dρ i=0 ρi

A neat trick to solve M/M/1 expected queue E[Q] = i=0 i(1 ρ)ρi E[Q] = (1 ρ)ρ i=0 iρi 1 E[Q] = (1 ρ)ρ dρ i i=0 dρ E[Q] = (1 ρ)ρ d dρ i=0 ρi E[Q] = (1 ρ)ρ d dρ 1 1 ρ

A neat trick to solve M/M/1 expected queue E[Q] = i=0 i(1 ρ)ρi E[Q] = (1 ρ)ρ i=0 iρi 1 E[Q] = (1 ρ)ρ dρ i i=0 dρ E[Q] = (1 ρ)ρ d dρ i=0 ρi E[Q] = (1 ρ)ρ d dρ 1 1 ρ E[Q] = (1 ρ)ρ 1 (1 ρ) 2

A neat trick to solve M/M/1 expected queue E[Q] = i=0 i(1 ρ)ρi E[Q] = (1 ρ)ρ i=0 iρi 1 E[Q] = (1 ρ)ρ dρ i i=0 dρ E[Q] = (1 ρ)ρ d dρ i=0 ρi E[Q] = (1 ρ)ρ d dρ 1 1 ρ E[Q] = (1 ρ)ρ 1 (1 ρ) 2 E[Q] = ρ 1 ρ. At last! the solution for M/M/1.

Queue size versus utilisation for M/M/1 100 80 60 E[q] 40 20 0 0 0.2 0.4 0.6 0.8 1 Utilisation

Queuing theory summary For the M/M/1 queue we have E[Q] = ρ/(1 ρ). As the utilisation goes to 1 the queue length goes to infinity. The mean waiting time can be found from Little s theorem N = E[Q]. Therefore T = ρ λ(1 ρ) = 1/µ 1 ρ = 1 µ λ. If we wanted an M/M/k queue (k servers) this is λ i = λ for all i and µ i = iµ for i < k and µ k = kµ. If we wanted an M/M/k/l queue (maximum l people in the queue) we would say λ k = 0 for k l. So it can be seen that we have solved a lot more in this lecture than simply M/M/1

Queuing theory summary This lecture can only scratch the surface of queuing theory. Little s Theorem relates queue size, arrivals and mean queuing time N = λt. The birth-death process is a very general way to look at queues of arrivals where arrivals and departures are related to Poisson processes. The birth-death process can be completely solved and the probability of every queue length calculated in terms of λ k and µ k. Utilisation is a measure of the fullness of the system ρ = λ/µ. M/M/1, M/M/k and M/M/k/l queues can be solved as birth-death processes.