Presentation on theme: "Methods of Stochastic Performance Analysis"— Presentation transcript:
1 Methods of Stochastic Performance Analysis Perry LeaHewlett Packard - Core Technology Laboratory
2 Why Am I Talking About This Currently I’m an ES working on future architectures and use these techniques with frequency to aid my design decisionsUsed these techniques to discover good designsUsed these techniques to stop bad designs
3 Who Uses This Stuff System Architects / Engineers / Scientists Transportation systemsIndustrial and production analysisBehavorialistsCommunication systemsand of course the general engineering community.
4 Typical Problems Addressed How fast will it print or copy?How do we distribute various tasks to various processors?What is the bus contention?Will we meet the real-time requirements?
5 What Is Performance Analysis (Jain Book Definition) Specifying performance requirementsComparing 2 or more systemsDetermining optimal/achievable parametersFinding bottlenecksCapacity planningWorkload planningThis talk is about:Stochastic AnalysisOperational AnalysisDiscrete Event Simulation
6 The Stochastic Process Anything that is observed as a random process in time is a stochastic process.A stochastic process can be discrete (good for CS folks) or continuous (good for signals folks)If a future state of your system is not dependent on a previous state, the process can be called a Markov process. This is good because Markov processes are easy to model.Memoryless propertyIf the arrival times of “data” to the different states are independent of each other – AND – the arrival times have the same distribution (hopefully exponentially distributed), then you can describe the process as a Poisson process.IID: Independent and identically distributed
7 Queue Rules the interarrival rate, time between 2 successive arrivals (Random Variable) the arrival rates the service time the mean service rate per server, or 1/E[s]n the number of jobs in the systemr the response time (includes time waiting in queue and actual cpu time)w the waiting time
8 Some Math l = arrival rate (going in) m = service rate (going out) r = l / m is the traffic intensity or densityThe probability that there are n tasks waiting in the queue is:
9 Birth Death Process The Birth – Death Process Each state represents the queue depth12j-1jj+1
10 Queues Kendall Notation A/B/C/D/E Types of processes A = arrival processB = service processC = number of serversD = maximum number of jobs for which the queue has room.E = maximum number of jobs being simulatedTypes of processesM = (Memoryless) Poisson arrival process or exponentially distributed service timeD = deterministic arrival process (each job has the same service time) Aha! Here’s the deterministic part of all this.G = general distribution arrival processE = Erlang distributionHyperexponential
11 Typical Queues M/M/1 M/G/1 Others Jobs arrive according to a Poisson processService time of each job is exponentially distributed.There is one serverThere is infinite waiting room and no limit to the number of jobsM/G/1Service time is generally distributed (no restriction of the form the distribution may take)OthersM/D/1 (D denotes each jobs take the same amount of time to be service)M/G/ (Infinite amount of servers available)G/M/1G/G/m
12 M/M/1 Model Analysis Traffic Intensity (Utilization): r = l/m Condition of Stability: r < 1Probability queue empty: p0 = 1 – rProbability queue = n: pn = (1-r)rn *Mean queue depth: E[n]=r/(1 - r)Mean waiting time: E[w]=r ((1/m) / (1-r))Mean response time (E[n] = /E[r]) *E[r] = (1/m) / (1-r)Other models have similar equations (See Jain Book)
13 M/M/1 ExampleA printer processes 125 packets per second and takes 2 ms to process them. When will the printer overflow with 13 buffers? How many buffers are needed to keep packet loss below one in a million?Arrival rate l = 125 ppsService rate m = 1/.002 = 500 ppsUtilization r = 0.25 or 25%Probability of n packets in gateway = (1-r)rn = 0.75(0.25)nMean number of packets in gateway = r/1-r = 0.33Probability of buffer overflow -> P(more than 13 packets)13 = = 15 packets in 1 billionTo limit the probability loss to 10-6n <= 10-6n > log(10-6) / log(0.25) = 9.96 buffers
14 Operational Laws (Denning and Buzen) (Simple formulas for finite observable time) If you observe a system for a finite amount of time, you can skip the distributions of service and interarrival times.You can use a set of simple (directly measurable) equations to predict performanceArrival Rate : # arrivals / time : Ai/TThroughput : # completions / time : Ci/TBusy Time : BiMean Service Time : total time served / # served : Bi / CiUtilization Law : U = Bi/T (T is the observed time)Forced Flow Law : system throughput : X = C0/TLittle’s Law : mean # in device = arrival rate * mean timeQi=i*RiBottleneck Identification : The device with the largest Di
15 Queuing Networks Open Network Closed Network Jackson product-form solutionClosed NetworkBuzen convolution algorithms
16 Large Queuing Networks Large systems can be modeled as a collection of queues.Bounding algorithmsFind upper and lower bounds only.Mean value analysis (MVA)Iterative method to find response times for each device in the system. This will sum to the system response time and overall queue lengths.Convolution algorithmsArray convolutionsCan answer more detailed questions than MVA, i.e. are 2 IO devices busy at the same time?For large networks, we use software simulators
17 Discrete Event Simulations Why use a simulator?Hard to build analytic models for:Virtual memoryResource sharing (CPU and IO)Mutual exclusion to resourcesBulk packet arrivals (self similarity)Non-exponential service timesCan run many variants and perturbations of a systemCan build stochastic and deterministic models and intermix them.To automate the mathematical processAllows you to study the problem from many angles with ease compared to analytical models
18 Modeling Tips Understand the architecture in detail first Decide on how detailed your model should beThe more detailed the more time, and possibly the more bugs you will introduceyou don’t want to build the final product.Do you need to model the whole system, or just a part?Get the abstraction defined before you start!!Chose the right tool and languageVerify and test the modelsState what the goal of the model is, know when to stopDon’t let mysterious results pass – understand them.Review the model design – like any other piece of code.
19 Good Simulation Tools http://www.idsia.ch/~andrea/simtools.html C++SIM Good site with links to many modeling toolsC++SIMC LibrariesDo it yourself standalone, no GUI, good for academicsOpnet ModelerMIL3, mainly for network and data flowCSIMLockheed Martin – good for computer and electronic systemsDiscrete and continuous modelsNT and Unix flavorsSES WorkbenchA generic modeling toolGUI, object orientated, NT and Unix
20 Recommended Reading“The Art of Computer Systems Performance Analysis”, Raj Jain, Wiley & Sons 1991“Performance Modeling for Computer Architects”, C. Krishna, IEEE Computer Society Press 1996“Telecommunication Networks”, Mischa Shwartz, Addison Wesley 1987