NETE4631:Capacity Planning (2)- Lecture 10 Suronapee Phoomvuthisarn, Ph.D. /

Slides:



Advertisements
Similar presentations
Lecture 5 This lecture is about: Introduction to Queuing Theory Queuing Theory Notation Bertsekas/Gallager: Section 3.3 Kleinrock (Book I) Basics of Markov.
Advertisements

Introduction to Queuing Theory
Queueing Models and Ergodicity. 2 Purpose Simulation is often used in the analysis of queueing models. A simple but typical queueing model: Queueing models.
Lab Assignment 1 COP 4600: Operating Systems Principles Dr. Sumi Helal Professor Computer & Information Science & Engineering Department University of.
TCOM 501: Networking Theory & Fundamentals
NETE4631:Capacity Planning (3)- Private Cloud Lecture 11 Suronapee Phoomvuthisarn, Ph.D. /
Lecture 13 – Continuous-Time Markov Chains
Nur Aini Masruroh Queuing Theory. Outlines IntroductionBirth-death processSingle server modelMulti server model.
ECS 152A Acknowledgement: slides from S. Kalyanaraman & B.Sikdar
CSE 221: Probabilistic Analysis of Computer Systems Topics covered: Simple queuing models (Sec )
1 Performance Evaluation of Computer Networks Objectives  Introduction to Queuing Theory  Little’s Theorem  Standard Notation of Queuing Systems  Poisson.
Single queue modeling. Basic definitions for performance predictions The performance of a system that gives services could be seen from two different.
1 Queuing Theory 2 Queuing theory is the study of waiting in lines or queues. Server Pool of potential customers Rear of queue Front of queue Line (or.
Data Communication and Networks Lecture 13 Performance December 9, 2004 Joseph Conron Computer Science Department New York University
Little’s Theorem Examples Courtesy of: Dr. Abdul Waheed (previous instructor at COE)
1 Multiple class queueing networks Mean Value Analysis - Open queueing networks - Closed queueing networks.
Rensselaer Polytechnic Institute © Shivkumar Kalvanaraman & © Biplab Sikdar1 ECSE-4730: Computer Communication Networks (CCN) Network Layer Performance.
7/3/2015© 2007 Raymond P. Jefferis III1 Queuing Systems.
Queuing Theory. Queuing theory is the study of waiting in lines or queues. Server Pool of potential customers Rear of queue Front of queue Line (or queue)
Queuing Networks: Burke’s Theorem, Kleinrock’s Approximation, and Jackson’s Theorem Wade Trappe.
Introduction to Queuing Theory. 2 Queuing theory definitions  (Kleinrock) “We study the phenomena of standing, waiting, and serving, and we call this.
Lecture 14 – Queuing Systems
Queuing Networks. Input source Queue Service mechanism arriving customers exiting customers Structure of Single Queuing Systems Note: 1.Customers need.
yahoo.com SUT-System Level Performance Models yahoo.com SUT-System Level Performance Models8-1 chapter12 Single Class MVA.
Introduction to Queuing Theory
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  …
Verification & Validation
Network Analysis A brief introduction on queues, delays, and tokens Lin Gu, Computer Networking: A Top Down Approach 6 th edition. Jim Kurose.
Introduction to Queuing Theory
Copyright ©: Nahrstedt, Angrave, Abdelzaher, Caccamo1 Queueing Systems.
Queuing models Basic definitions, assumptions, and identities Operational laws Little’s law Queuing networks and Jackson’s theorem The importance of think.
MIT Fun queues for MIT The importance of queues When do queues appear? –Systems in which some serving entities provide some service in a shared.
Introduction to Operations Research
Lecture 14 – Queuing Networks Topics Description of Jackson networks Equations for computing internal arrival rates Examples: computation center, job shop.
Lecture 10: Queueing Theory. Queueing Analysis Jobs serviced by the system resources Jobs wait in a queue to use a busy server queueserver.
Flows and Networks Plan for today (lecture 6): Last time / Questions? Kelly / Whittle network Optimal design of a Kelly / Whittle network: optimisation.
Introduction to Queueing Theory
Network Design and Analysis-----Wang Wenjie Queueing System IV: 1 © Graduate University, Chinese academy of Sciences. Network Design and Analysis Wang.
Queuing Theory Basic properties, Markovian models, Networks of queues, General service time distributions, Finite source models, Multiserver queues Chapter.
TexPoint fonts used in EMF.
1 Elements of Queuing Theory The queuing model –Core components; –Notation; –Parameters and performance measures –Characteristics; Markov Process –Discrete-time.
Network Design and Analysis-----Wang Wenjie Queuing Theory III: 1 © Graduate University, Chinese academy of Sciences. Network Design and Performance Analysis.
CDA6530: Performance Models of Computers and Networks Chapter 7: Basic Queuing Networks TexPoint fonts used in EMF. Read the TexPoint manual before you.
State N 2.6 The M/M/1/N Queueing System: The Finite Buffer Case.
NETE4631: Network Information System Capacity Planning (2) Suronapee Phoomvuthisarn, Ph.D. /
OPERATING SYSTEMS CS 3530 Summer 2014 Systems and Models Chapter 03.
Internet Applications: Performance Metrics and performance-related concepts E0397 – Lecture 2 10/8/2010.
Copyright ©: Nahrstedt, Angrave, Abdelzaher, Caccamo1 Queueing Systems.
Queuing Theory.  Queuing Theory deals with systems of the following type:  Typically we are interested in how much queuing occurs or in the delays at.
Chap 2 Network Analysis and Queueing Theory 1. Two approaches to network design 1- “Build first, worry later” approach - More ad hoc, less systematic.
Flows and Networks Plan for today (lecture 6): Last time / Questions? Kelly / Whittle network Optimal design of a Kelly / Whittle network: optimisation.
Random Variables r Random variables define a real valued function over a sample space. r The value of a random variable is determined by the outcome of.
Simple Queueing Theory: Page 5.1 CPE Systems Modelling & Simulation Techniques Topic 5: Simple Queueing Theory  Queueing Models  Kendall notation.
QUEUING THEORY 1.  - means the number of arrivals per second   - service rate of a device  T - mean service time for each arrival   = ( ) Utilization,
1 BIS 3106: Business Process Management (BPM) Lecture Nine: Quantitative Process Analysis (2) Makerere University School of Computing and Informatics Technology.
Managerial Decision Making Chapter 13 Queuing Models.
OPERATING SYSTEMS CS 3502 Fall 2017
CTMCs & N/M/* Queues.
Lecture on Markov Chain
Finite M/M/1 queue Consider an M/M/1 queue with finite waiting room.
Queuing models Basic definitions, assumptions, and identities
System Performance: Queuing
Queuing models Basic definitions, assumptions, and identities
TexPoint fonts used in EMF.
TexPoint fonts used in EMF.
Introduction to Queueing Theory
Lecture 13 – Queuing Systems
Queueing networks.
TexPoint fonts used in EMF.
LECTURE 09 QUEUEING THEORY PART3
Presentation transcript:

NETE4631:Capacity Planning (2)- Lecture 10 Suronapee Phoomvuthisarn, Ph.D. /

Lecture Outline  Basic terminology  Queueing Analysis  M/M/1  M/M/m  M/M/m/m  Exercise

Capacity planning strategies  Capacity planning problems:  A web server needs to complete an HTTP request within 0.5s when there are 500 HTTP requests per second, what CPU speed do you need?  Let us turn the capacity planning question into a performance analysis question  Performance analysis question:  If the web server has a CPU with x MIPS, what is the response time when there are 500 HTTP requests per second?  If you can solve the performance analysis question for any value of x, you can also solve the capacity planning question  Solutions:  Build the system and perform measurement  Simulation  Mathematical modeling.

Modelling computer systems  Single server queue considers only a component within a computer system  A request may require multiple resources E.g. CPU, disk, network transmission  We model a computer systems with multiple resources by a Queueing Networks (QNs)

Representation of queue

A simple database server

Queueing analysis - Scale up or Scale out better?

Queues with Poisson arrivals  Open, single server queues and  How to find:  Waiting time  Response time  Mean queue length etc.  The technique to find waiting time etc. is called Queueing Theory

Single Server Queue: Terminology  Response Time T = Waiting time W + Service time S

Single Server Queue: Terminology

Motivating example  Given  Observation period = 1 minute  CPU  Busy for 36s.  1790 transactions arrived  1800 transactions completed  Find  Mean service time per completion  Utilisation  Arrival rate  System throughput

Little’s Law  Applicable to any “box” that contains some queues or servers  Mean number of jobs in the “box” =  Mean response time x Throughput  We will use Little’s Law in this lecture to derive the mean response time  We first compute the mean number of jobs in the “box” and throughput

Single server system  In order to determine the response time, you need to know  The inter-arrival time probability distribution  The service time probability distribution  Possible distributions  Deterministic  Constant inter-arrival time  Constant service time  Exponential distribution  We will focus on exponential distribution  Exponential inter-arrivals ( λ )  Exponential service time ( μ )

Exponential inter-arrival with rate λ  We assume that successive arrivals are independent  Probability that inter-arrival time is between x and x + δ x = λ exp(- λ x) δ x

Probabilistic distribution function

Poisson distribution (1)  The following are equivalent  The inter-arrival time is independent and exponentially distributed with parameter λ  The number of arrivals in an interval T is a Poisson distribution with parameter λ  Mean inter-arrival time = 1 / λ  Mean number of arrivals in time interval T = λ T  Mean arrival rate = λ

Poisson distribution (2)  Assumption of Poisson arrival process  The number of customers in the system is very large.  Impact of a single customer on the performance of the system is very small, i.e. a single customer consumes a very small percentage of the system resources.  All customers are independent, i.e. their decision to use the system are independent of other users.

Explore …

Service time distribution  Service time = the amount of processing time a job requires from the server  We assume that the service time distribution is exponential with parameter μ  The probability that the service time is between t and t + δ t is:  Here: μ = service rate = 1 / mean service time  Another interpretation of exponential service time:  Consider a small time interval δ  Probability [ a job will finish its service in next δ seconds ] = μ δ

Sample queueing problems  Consider a call centre  Calls are arriving according to Poisson distribution with rate λ  The length of each call is exponentially distributed with parameter μ  Mean length of a call is 1/ μ  Queueing theory will be able to answer these questions:  What is the mean waiting time for a call?  What is the probability that a call is rejected?

Markov chain  The state-transition model that we have used is called a continuous-time Markov chain  The transition from a state of the Markov chain to another state is characterised by an exponential distribution  E.g. The transition from State p to State q is exponential with rate r pq, then consider a small time interval δ  Probability [ Transition from State p to State q in time δ ] = r pq δ

Method for solving Markov chain  A Markov chain can be solved by  Identifying the states (may not be easy)  Find the transition rate between the states  Solve the steady state probabilities  You can then use the steady state probabilities as a stepping stone to find the quantity of interest (e.g. response time etc.)

Call centre with 1 operator and no holding slots  Let us see how we can solve the queuing problem for a very simple call centre with 1 operator and no holding slots  What happens to a call that arrives when the operator is  busy?  The call is rejected  What happens to a call that arrives when the operator is  idle?  The call is admitted without delay.  We are interesting to find the probability that an arriving call is rejected.

Solution (1)  There are two possibilities for the operator:  He is busy or  He is idle  Let  State 0 = Operator is idle (= zero call in the call centre)  State 1 = Operator is busy (= 1 call in the call centre)

Solution (2)  Transition from State 0 to State 1  Caused by an arrival, the rate is λ  Transition from State 1 to State 0  Caused by a completed service, the rate is μ  State diagram representation  Each circle is a state  Label the arc between the states with transition rate

Solution (3)  Steady state means  We have for state 0:

Solution (4)  We can do the same for State 1:  Steady state means  We have for state 1:

Solution (5)  We have one equation  We have 2 unknowns and we need one more equation.  Since we must be either one of the two states:  Solving these two equations, we get the same steady state solution as before

Solving a queueing problem  Procedure:  Draw a diagram with the states  Add arcs between states with transition rates  Derive flow balance equation for each state, i.e.  Rate of entering a state = Rate of leaving a state  Solve the equation for steady state probability  It is harder to find how a queue evolves with time  It is simpler to find how a queue behaves at steady state

Kendall’s notation  To represent different types of queues, queueing theorists use the Kendall’s notation  The call centre example on the previous page can be represented as:  The call centre example on the last page is a M/M/m/(m+n) queue If n = ∞, we simply write M/M/m

M/M/1 queue  Consider a call centre analogy  Calls are arriving according to Poisson distribution with rate λ  The length of each call is exponentially distributed with parameter μ  Mean length of a call is 1/ μ  Queueing theory will be able to answer these questions:  What is the mean waiting time for a call?

Solving M/M/1 queue (1)  We will solve for the steady state response  Define the states of the queue  State 0 = There is zero job in the system (= The server is idle)  State 1 = There is 1 job in the system (= 1 job at the server, no job queueing)  State 2 = There are 2 jobs in the system (= 1 job at the server, 1 job queueing)  State k = There are k jobs in the system (= 1 job at the server, k-1 job queueing)  The state transition diagram

Solving M/M/1 queue (2)

Solving M/M/1 queue (3)

Solving M/M/1 queue (4)

Solving M/M/1 queue (5)

Solving M/M/1 queue (6)

Solving M/M/1 queue (7)

Solving M/M/1 queue (8)

Solving M/M/1 queue (9)

Observing response time

Multi-server queues M/M/m

A call centre analogy of M/M/m queue  Consider a call centre analogy  Calls are arriving according to Poisson distribution with rate λ  The length of each call is exponentially distributed with parameter μ  Mean length of a call is 1/ μ

State transition for M/M/m

M/M/m  This is a Markov chain, we have mean response time T is

Multi-server queues M/M/m/m with no waiting room

A call centre analogy of M/M/m/m queue  Consider a call centre analogy  Calls are arriving according to Poisson distribution with rate λ  The length of each call is exponentially distributed with parameter μ  Mean length of a call is 1/ μ

State transition for M/M/m/m

What configuration has the best response time?

References  Most of the slides have been modified from COMP9334 Capacity Planning of Computer Systems and Networks Week 1-4: Introduction to Capacity Planning, Chou, C. T., 2008  Recommended reading from Chou  Queues with Poisson arrival are discussed in Bertsekas and Gallager, Data Networks, Sections 3.3 to  Note: Chou has derived the formulas here using continuous Markov chain but Bertsekas and Gallager used discrete Markov chain.

Example  You have a computer system with a single CPU. Both inter- arrival and service times are exponentially distributed. The job only requires services at the CPU. Each job only visits the CPU once. A finished job will leave the system. Mean arrival rate is 9 request/s. Mean service time at the CPU is 0.1s.  What is the utilisation of the CPU?  What is the mean response time?  The utilisation is pretty high and you want to change the system.  -> You can think of 3 alternatives.

Alternative 1  Replace the existing CPU by one that is 2 times faster  You may assume that the service time is inversely proportional to CPU speed.

Alternative 2  Buy a system which is identical to the current one  Put the two system in parallel  Add a switch in front of the system  Route 1st,3rd,5th,… requests to System 1  Route 2nd,4th,6th … requests to System 2  Assume the switch requires negligible time

Alternative 3  Similar to Alternative 2, we buy a system which is identical to the current one and we also buy a switch  However, we only maintain a queue at the switch.  If both system are busy, the request waits at the switch; otherwise, the switch dispatches the request to any of the available systems  Assuming that it takes negligible time for the switch to find out whether a system is idle.

Question 1  Part (a): Calculate the resulting mean response time for each for the three alternatives  Part (b): Repeat part (a) for a number of different mean arrival rates. Plot a graph of arrival rates against the mean response time.  Part (c): What observations can you make from these calculations?  Part (d): What is the best way to upgrade the system in terms of performance? However, the best way to upgrade in terms of performance may not be the best way to upgrade in terms of cost, why?