Copyright warning. COMP5348 Lecture 6: Predicting Performance Adapted with permission from presentations by Alan Fekete.

Slides:



Advertisements
Similar presentations
Lab Assignment 1 COP 4600: Operating Systems Principles Dr. Sumi Helal Professor Computer & Information Science & Engineering Department University of.
Advertisements

Lecture 10 – Introduction to Probability Topics Events, sample space, random variables Examples Probability distribution function Conditional probabilities.
Probability & Statistical Inference Lecture 3
The Theory of Queues Models of Waiting in line. Queuing Theory Basic model: Arrivals  Queue  Being Served  Done – Queuing theory lets you calculate:
Queuing Analysis Based on noted from Appendix A of Stallings Operating System text 6/10/20151.
ECS 152A Acknowledgement: slides from S. Kalyanaraman & B.Sikdar
OS Fall ’ 02 Performance Evaluation Operating Systems Fall 2002.
1 Performance Evaluation of Computer Networks Objectives  Introduction to Queuing Theory  Little’s Theorem  Standard Notation of Queuing Systems  Poisson.
Performance Evaluation
The Theory of Queues Models of Waiting in line. Queuing Theory Basic model: Arrivals  Queue  Being Served  Done – Queuing theory lets you calculate:
Discrete Probability Distributions
Queueing Theory.
OS Fall ’ 02 Performance Evaluation Operating Systems Fall 2002.
1 Part VI System-level Performance Models for the Web © 1998 Menascé & Almeida. All Rights Reserved.
Lecture 4 Mathematical and Statistical Models in Simulation.
McGraw-Hill Ryerson Copyright © 2011 McGraw-Hill Ryerson Limited. Adapted by Peter Au, George Brown College.
Week 51 Relation between Binomial and Poisson Distributions Binomial distribution Model for number of success in n trails where P(success in any one trail)
11/5/2003Probability and Statistics for Teachers, Math 507, Lecture 10 1 UNIFORM AND EXPONENTIAL RANDOM VARIABLES Sections
Lecture 10 – Introduction to Probability Topics Events, sample space, random variables Examples Probability distribution function Conditional probabilities.
Problem A newly married couple plans to have four children and would like to have three girls and a boy. What are the chances (probability) their desire.
Sets, Combinatorics, Probability, and Number Theory Mathematical Structures for Computer Science Chapter 3 Copyright © 2006 W.H. Freeman & Co.MSCS SlidesProbability.
Sets, Combinatorics, Probability, and Number Theory Mathematical Structures for Computer Science Chapter 3 Copyright © 2006 W.H. Freeman & Co.MSCS SlidesProbability.
AN INTRODUCTION TO THE OPERATIONAL ANALYSIS OF QUEUING NETWORK MODELS Peter J. Denning, Jeffrey P. Buzen, The Operational Analysis of Queueing Network.
M EAN -V ALUE A NALYSIS Manijeh Keshtgary O VERVIEW Analysis of Open Queueing Networks Mean-Value Analysis 2.
880.P20 Winter 2006 Richard Kass 1 Confidence Intervals and Upper Limits Confidence intervals (CI) are related to confidence limits (CL). To calculate.
CPSC 531: Probability Review1 CPSC 531:Distributions Instructor: Anirban Mahanti Office: ICT Class Location: TRB 101.
PROBABILITY & STATISTICAL INFERENCE LECTURE 3 MSc in Computing (Data Analytics)
1 Chapter 5 Flow Lines Types Issues in Design and Operation Models of Asynchronous Lines –Infinite or Finite Buffers Models of Synchronous (Indexing) Lines.
5-1 Business Statistics: A Decision-Making Approach 8 th Edition Chapter 5 Discrete Probability Distributions.
Copyright © 2010, 2007, 2004 Pearson Education, Inc. Review and Preview This chapter combines the methods of descriptive statistics presented in.
Chapter 6 Scheduling. Basic concepts Goal is maximum utilization –what does this mean? –cpu pegged at 100% ?? Most programs are I/O bound Thus some other.
NETE4631:Capacity Planning (2)- Lecture 10 Suronapee Phoomvuthisarn, Ph.D. /
Queuing Theory Basic properties, Markovian models, Networks of queues, General service time distributions, Finite source models, Multiserver queues Chapter.
Entities and Objects The major components in a model are entities, entity types are implemented as Java classes The active entities have a life of their.
1 Elements of Queuing Theory The queuing model –Core components; –Notation; –Parameters and performance measures –Characteristics; Markov Process –Discrete-time.
BINOMIALDISTRIBUTION AND ITS APPLICATION. Binomial Distribution  The binomial probability density function –f(x) = n C x p x q n-x for x=0,1,2,3…,n for.
Psyc 235: Introduction to Statistics DON’T FORGET TO SIGN IN FOR CREDIT!
Queueing Theory Dr. Ron Lembke Operations Management.
Copyright ©2011 Pearson Education, Inc. publishing as Prentice Hall 5-1 Business Statistics: A Decision-Making Approach 8 th Edition Chapter 5 Discrete.
Stat 13 Lecture 19 discrete random variables, binomial A random variable is discrete if it takes values that have gaps : most often, integers Probability.
Chapter 01 Probability and Stochastic Processes References: Wolff, Stochastic Modeling and the Theory of Queues, Chapter 1 Altiok, Performance Analysis.
Probability Review CSE430 – Operating Systems. Overview of Lecture Basic probability review Important distributions Poison Process Markov Chains Queuing.
Chapter 01 Probability and Stochastic Processes References: Wolff, Stochastic Modeling and the Theory of Queues, Chapter 1 Altiok, Performance Analysis.
1 Components performance modelling - Outline of queue networks - Mean Value Analisys (MVA) for open and close queue networks.
OMSAN LOJİSTİK. Top Management Program in Logistics & Supply Chain Management (TMPLSM) Production and Operations Management 3: Process Analysis.
Random Variable The outcome of an experiment need not be a number, for example, the outcome when a coin is tossed can be 'heads' or 'tails'. However, we.
Inference: Probabilities and Distributions Feb , 2012.
NETE4631: Network Information System Capacity Planning (2) Suronapee Phoomvuthisarn, Ph.D. /
OPERATING SYSTEMS CS 3530 Summer 2014 Systems and Models Chapter 03.
Ó 1998 Menascé & Almeida. All Rights Reserved.1 Part VI System-level Performance Models for the Web (Book, Chapter 8)
Internet Applications: Performance Metrics and performance-related concepts E0397 – Lecture 2 10/8/2010.
Binomial Distributions Chapter 5.3 – Probability Distributions and Predictions Mathematics of Data Management (Nelson) MDM 4U.
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.
STROUD Worked examples and exercises are in the text Programme 29: Probability PROGRAMME 29 PROBABILITY.
Chapter 5 Probability Distributions 5-1 Overview 5-2 Random Variables 5-3 Binomial Probability Distributions 5-4 Mean, Variance and Standard Deviation.
Queueing Fundamentals for Network Design Application ECE/CSC 777: Telecommunications Network Design Fall, 2013, Rudra Dutta.
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.
QUEUING THEORY 1.  - means the number of arrivals per second   - service rate of a device  T - mean service time for each arrival   = ( ) Utilization,
The expected value The value of a variable one would “expect” to get. It is also called the (mathematical) expectation, or the mean.
Nonlinear function minimization (review). Newton’s minimization method Ecological detective p. 267 Isaac Newton We want to find the minimum value of f(x)
Ó 1998 Menascé & Almeida. All Rights Reserved.1 Part VI System-level Performance Models for the Web.
OPERATING SYSTEMS CS 3502 Fall 2017
Review of Probability Theory
Simulation Statistics
Queuing Theory Queuing Theory.
Project Management for Software Engineers (Summer 2017)
Probability distributions
COMP60611 Fundamentals of Parallel and Distributed Systems
Presentation transcript:

Copyright warning

COMP5348 Lecture 6: Predicting Performance Adapted with permission from presentations by Alan Fekete

Outline Approaches to Performance Prediction Operational Laws Performance bounds for closed systems M/M/1 systems

Extrapolation Measure the performance for some values of vital parameters  Eg measure response time with 10, 20, 30 clients Fit a curve through the measured data Use the curve to predict performance for other values of parameters Big problem: performance can change radically when system reaches capacity  Interpolation works well, but not extrapolation

Simulation Build a computer-based model with tasks and resources and events  Based on randomized values for what is done, and how much resource each task uses  Using simulation frameworks eg NS2 Execute the model, and see what happens  Eg do queues build up? How many requests are handled in given time? Problem: coding a reasonable model is very difficult, and takes a lot of time Problem: getting key parameters is hard  Eg how long each request uses a given disk

Analytical (Queuing) Models Build a mathematical model, with resources and queues and probabilities for state transitions Solve for the steady state behaviour  Either exact solution (as a function)  Or approximate solution of the relevant equations by iteration Not as precise as simulation, but usually far easier Some simple results can be done back-of-an- envelope, without depending on precise knowledge of the distribution of random values

Basic probability (discrete cases) P(A): the fraction of occurrences of event A among all possible cases  Eg cases are all possible ways to toss 20 coins  One case is HTHHTHTHTTHTTTTHHHTH  A case is a simple event P(HTHHTHTHTTHTTTTHHHTH)=1/2 20  One event is “A1: fourth toss is heads”; P(A1)=0.5  Another event is “A2: First head is at toss 4”; P(A2)= P(A) must be between 0 and 1 (inclusive)  What does P(A)=0 mean? P(not A) = 1 - P(A) P(A and B) = P(A)*P(B)  If A independent of B (they are not correlated) P(A or B) = P(A)+P(B)-P(A and B)  Approximately P(A)+P(B) if A independent of B, and both are rare

Random variable (discrete cases) Give a numeric value to each possible situation  Eg cases are possible ways to toss 20 coins; Random value is number of heads seen Expected value  Weighted average of random variable among the various cases E(X) = ∑ i X(case i)*P(case i)

Uniform distribution (discrete cases) Integer valued random variable All values are equally likely, within the range allowed

Binomial distribution (discrete cases) Number of successes among n attempts, when each attempt has chance p of success P(X=k) = (k!(n-k)!/n!) p n (1-p) n Expected value E(X)= np See

Continuous cases Where there are infintely many possible situations  Eg each situation is one execution of a system Assign probabilities to events  An event is a subset of situations  Eg event is”no processor crashed during the execution”  Or “the 5th request was processed at node 17”  Events can overlap with one another Random variable is a value associated with each situation  Eg “the number of requests processed during the execution” Probability density function

Uniform distribution Discrete cases: All values are equally likely, with a finite set of allowed values  Continuous cases: Any range has probability proportional to the length of the range (as long as range is within the set of allowed values) Eg “all file lengths are equally likely, from 0 bytes to 1 Mbyte” Easy to work with mathematically, but may not be an accurate approximation to reality!

Normal distribution Two parameters  and  Pdf(x) = (  √( 2  )) -1 exp( -(x-  ) 2 /  2 ) Distribution is symmetric around X=   Expected value is    is a measure of the spread Many real situations are closely approximated as normal distributions  Combined impact of many independent variations See

Exponential distribution One parameter Pdf(x) = exp(- x)  Expected value = 1/ Memoryless distribution  Time between events, if the past has no impact on the future See

Poisson distribution Number of occurrences of an event with exponential distribution on inter-event gaps  A good approximation to binomial distribution when np=, and n is big and p is small The probability of having value k is  Prob(k) = ( k exp(- ))/k!  Expected value = See

Outline Approaches to Performance Prediction Operational Laws Performance bounds for closed systems M/M/1 systems

The main independent parameter For a closed system  N: the number of clients that submit jobs Also, the number of jobs that are either in the system, or “thinking” at the client  Z: think time, between when a job is completed and when the same client submits another job For an open system  : the arrival rate of jobs per second

Work is done at different devices V i : (average) number of visits by a single job to device i S i : average service time (time spent actually using the device, not queueing etc) for a visit at device I i average arrival rate of visits per second at device I X i : Throughput of device i (visits completed per second)  i average service rate of visits at device I  Number of visits that could be completed per second, if the device were kept continually busy =1/ S i D i : service demand per job at device i = V i * S i U i : Utilisation of device i  Fraction of time device is busy = i * S i

The main performance measures Throughput X: the (average) number of jobs completed per second Response time R: the (average) time from submitting a job till it is completed

Little’s Law N = T  Applies to any system in steady state N is number of jobs in the “system” T is the average time spent in the “system” is the average rate of arrival (or departure) from the system This law can be applied to any part of the system  It doesn’t depend on knowing the shape of the distribution of parameters It can be applied to a larger whole with a closed computer-system plus the clients  N = X*(R+Z), that is, R = N/X - Z This is called “interactive response time law”

Relating a device to the whole system Forced Flow Law  X i = V i * X Service Demand Law (“Bottleneck Law”)  U i = D i * X

Outline Approaches to Performance Prediction Operational Laws Performance bounds for closed systems M/M/1 systems

Performance bounds Let D max be the largest among the D i The device i where the max occurs is called the “bottleneck” for the system X <= 1/ D max  Because U i must be at most 1. So R >= N* D max - Z X and R are close to the bounds, when load is high

Performance bounds Let D be the sum of all the D i R >= D  Because the total time to deal with a job includes the time at each device, plus also queuing time So X <= N/ (D + Z) X and R are close to the bounds, when load is low

Effect of the bounds N X N R 1/D max Queues start to build up badly, as bottleneck is saturated Low load bound High load bound

System design The bottleneck is the device i with largest D i The only way to get better throughput than 1/ D max is to change the system design to change D max  Move some tasks away from the bottleneck device Add some new devices to take some of the load Or re-arrange processing so some visits go to other existing devices instead  Or, change the nature of the device so each request needs less service time Eg change for a faster disk After the system is redesigned, there will still be a bottleneck!  Perhaps on a different device

Outline Approaches to Performance Prediction Operational Laws Performance bounds for closed systems M/M/1 systems

M/M/1 Assume jobs arrive by Poisson process  Inter-arrival time gap has exponential distribution  Average number of arrivals per second is Assume the service demand is also exponential distribution  Average number of services possible per second is  The essential parameter is load , defined by / 

M/M/1 Queuing Theory Average number of jobs in (queue or being served) is N =  /(1-  ) Average number of jobs in queue is N wait  N wait =  2 /(1-  ) Average time in system (waiting or being served) is T = 1/  (1-  ) Average waiting time in queue is T wait =  /  (1-  )

Impact of queues If is close to , then the queue builds up to be long  And each job is delayed a long time  Note contrast with situation of exactly periodic arrival of jobs, and exactly equal service times, where there is never a queue as long as is below  We aim to keep load  at the bottleneck resource to be below 0.8, say  Thus we do not let any resource get saturated

Heavy tailed distributions In general, distributions which are spread more from the average have longer queues and worse response times This is especially serious for distributions like power-laws, where the few extremely big jobs can clog the system giving bad response time for every job

Further reading D. Menasce, V. Almeida, L. Dowdy “Performance by Design”, pub by Prentice- Hall, 2004