Chapter 11. Performance Modeling

Similar documents
Chapter 11. Performance Modeling

Performance Evaluation of Queuing Systems

QUEUING SYSTEM. Yetunde Folajimi, PhD

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 "

Analysis of Software Artifacts

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

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

BIRTH DEATH PROCESSES AND QUEUEING SYSTEMS

Introduction to Queueing Theory

Introduction to Queueing Theory

Introduction to Queueing Theory

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

CS 700: Quantitative Methods & Experimental Design in Computer Science

Part I Stochastic variables and Markov chains

Analysis of A Single Queue

Queues and Queueing Networks

Exercises Solutions. Automation IEA, LTH. Chapter 2 Manufacturing and process systems. Chapter 5 Discrete manufacturing problems

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

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

Data analysis and stochastic modeling

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

PBW 654 Applied Statistics - I Urban Operations Research

IEOR 6711, HMWK 5, Professor Sigman

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

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

Introduction to Markov Chains, Queuing Theory, and Network Performance

Non Markovian Queues (contd.)

Exercises Stochastic Performance Modelling. Hamilton Institute, Summer 2010

Stationary Probabilities of Markov Chains with Upper Hessenberg Transition Matrices

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

Stochastic Models of Manufacturing Systems

Figure 10.1: Recording when the event E occurs

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

Time Reversibility and Burke s Theorem

Link Models for Packet Switching

Che-Wei Chang Department of Computer Science and Information Engineering, Chang Gung University

Introduction to queuing theory

Lecture 20: Reversible Processes and Queues

Chapter 6 Queueing Models. Banks, Carson, Nelson & Nicol Discrete-Event System Simulation

Elementary queueing system

Chapter 1. Introduction. 1.1 Stochastic process

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

Synchronized Queues with Deterministic Arrivals

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

Continuous Time Processes

Lecturer: Olga Galinina

Systems Simulation Chapter 6: Queuing Models

Little s result. T = average sojourn time (time spent) in the system N = average number of customers in the system. Little s result says that

One billion+ terminals in voice network alone

Introduction to Queuing Theory. Mathematical Modelling

Performance Metrics for Computer Systems. CASS 2018 Lavanya Ramapantulu

TDDI04, K. Arvidsson, IDA, Linköpings universitet CPU Scheduling. Overview: CPU Scheduling. [SGG7] Chapter 5. Basic Concepts.

Queueing Theory and Simulation. Introduction

Recap. Probability, stochastic processes, Markov chains. ELEC-C7210 Modeling and analysis of communication networks

Uniform random numbers generators

Part II: continuous time Markov chain (CTMC)

Module 5: CPU Scheduling

MARKOV PROCESSES. Valerio Di Valerio

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

Queuing Theory. Using the Math. Management Science

Generation of Discrete Random variables

Computer Systems Modelling

Dynamic resource sharing

Stochastic process. X, a series of random variables indexed by t

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

Slides 9: Queuing Models

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

EP2200 Course Project 2017 Project II - Mobile Computation Offloading

Statistics 150: Spring 2007

Minimizing response times and queue lengths in systems of parallel queues

Glossary availability cellular manufacturing closed queueing network coefficient of variation (CV) conditional probability CONWIP

Chapter 2 Queueing Theory and Simulation

Markov Chains. X(t) is a Markov Process if, for arbitrary times t 1 < t 2 <... < t k < t k+1. If X(t) is discrete-valued. If X(t) is continuous-valued

Name of the Student:

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

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

CHAPTER 4. Networks of queues. 1. Open networks Suppose that we have a network of queues as given in Figure 4.1. Arrivals

Cover Page. The handle holds various files of this Leiden University dissertation

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.

Session-Based Queueing Systems

NCU EE -- DSP VLSI Design. Tsung-Han Tsai 1

Continuous-Time Markov Chain

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

Základy teorie front

HITTING TIME IN AN ERLANG LOSS SYSTEM

Computer Networks More general queuing systems

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

Review of Queuing Models

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

Lecture Notes 7 Random Processes. Markov Processes Markov Chains. Random Processes

Section 1.2: A Single Server Queue

Real-time operating systems course. 6 Definitions Non real-time scheduling algorithms Real-time scheduling algorithm

STEADY-STATE PROBABILITIES FOR SOME QUEUEING SYSTEMS: Part II

Link Models for Circuit Switching

Advanced Computer Networks Lecture 3. Models of Queuing

Q = (c) Assuming that Ricoh has been working continuously for 7 days, what is the probability that it will remain working at least 8 more days?

Operational Laws Raj Jain

INF2270 Spring Philipp Häfliger. Lecture 8: Superscalar CPUs, Course Summary/Repetition (1/2)

Introduction to queuing theory

Chapter 6: CPU Scheduling

Transcription:

Chapter Performance Modeling

. Problem Statement Whether a computer system consisting of hard- and software really achieves the desired performance turns out during operation at the latest. Then, however, it is too late. Similar to other areas of engineering (e.g. architecture, aviation) quantitative issues (performance, capacity) need to accompany the design process and be interwoven with it. Whereas the performance of hardware components can be determined relatively easily, the performance of a complete computer system depends on the complex interplay of software and hardware components. It is the responsibility of the operating system to organize this interplay in the most efficient way to achieve the maximum performance. Barry Linnert, linnert@inf.fu-berlin.de, Betriebssysteme WS 05/6 -

Impact factors on the performance The performance data of the machine (MIPS per core, number of cores, memory capacity, bus bandwidth,...) set upper bounds for the performance of the computer system. To what extent this performance capacity can be exploited depends on the program load that more or less fits the properties of the machine. The operating system tries by using appropriate strategies and a suitable program mix to provide all active components with useful wor. Barry Linnert, linnert@inf.fu-berlin.de, Betriebssysteme WS 05/6-3

Impact factors on the performance Finally, the user or operator/owner of the computing system defines the ultimate performance goals from which particular performance measures can be derived. Goals Load ( Programs + Input data) Operating system adaptation Machine Performance Barry Linnert, linnert@inf.fu-berlin.de, Betriebssysteme WS 05/6-4

What is performance? Depending on the perspective and the application area, different measures for performance are useful. Performance measures are usually based on the intuitive physical notion of power: power (performance) wor per time It is measured how long some action taes (memory cycle time, bloc transfer time, response time, program runtime, pacet delay,...) how many actions per time unit are performed (MIPS, MFLOPS, transactions/sec, Jobs/h, Mbit/sec, SPECmars ) As can be seen from the examples, pure hardware measures and measures for complete HW/SW systems are used. Barry Linnert, linnert@inf.fu-berlin.de, Betriebssysteme WS 05/6-5

How can performance be assessed? At the real system If the system to be evaluated is at disposal, we can use measurements. A device to measure the system s behavior is called monitor. Monitors can be realized in hardware or in software. Hardware monitor A monitor device consists of several probes, that are connected at those places where something is to be measured. Typical components : Counter Logic elements Comparer Cloc Dis / Tape counting of specific events combination of special signals Recognition of particular signal values (e.g. specific address) To provide logged events with a timestamp recording of signals or events Measures hardware quantities, e.g. addresses, instruction execution times, bus assignment, cache misses, etc. High time resolution (nsec), high sampling rate, usually no performance impact. Barry Linnert, linnert@inf.fu-berlin.de, Betriebssysteme WS 05/6-6

How can performance be assessed? Software Monitor A program system embedded into an application system or operating system Measures software quantities, e.g. operating system calls, procedure execution times, woring set sizes Uses system resources, i.e. influences performance and may distort measurements to some degree Time resolution dependent on system cloc System specific Operation modes On-line-operation: Off-line-operation: Representation of measurements on-line during operation Recording of events (trace) on secondary memory for later postprocessing and evaluation Barry Linnert, linnert@inf.fu-berlin.de, Betriebssysteme WS 05/6-7

Monitors Monitors are useful for bottlenec analysis and optimization of existent hard-/software systems. If we can measure the call frequencies of particular operating system modules, we now at which place further code optimization is profitable. If we can measure statistical profile of memory requests, we can optimize the memory management scheme towards this profile. If we now the bloc access frequencies at the dis storage we tune the trac allocation to minimize head movements and thus access times. If we now the behavior of individual programs (e.g. compute bound vs. I/O-bound), we can achieve high utilization by a suitable program mix. If the performance of a system is poor, it may not be the processor to be blamed: The bottlenec may be the memory (too much paging) the cache (too low hit ratio) the bus (too many bus conflicts) All this can be found out using monitors. Barry Linnert, linnert@inf.fu-berlin.de, Betriebssysteme WS 05/6-8

Characterizing the Program Load Processor performance indicators such as MIPS or MFLOPS are based on a weighted mix of individual instructions. They only tell you something about performance if the processor is really the bottlenec. I/O behavior and possible performance loss due to the operating system remains unconsidered. Example: Gibson Instruction Mix Instruction type percentage Load and Store 3. Fixed-Point Add and Subtract 6. Compares 3.8 Branches 6.6 Floating Point Add and Subtract 6.9 Floating Multiply 3.8 Floating Divide.5 Fixed-Point Multiply 0.6 Fixed-Point Divide 0. Shifting 4.4 Logical, And, Or.6 Instructions not using registers 5.3 Indexing 8.0 00.0 Barry Linnert, linnert@inf.fu-berlin.de, Betriebssysteme WS 05/6-9

Characterizing the Program Load Synthetic Programs A synthetic program is a special small test program in a higher programming language that mainly consists of operating system calls and I/O operations. It is supposed to mimic program behavior in a condensed way. It is easily portable and adaptable. Effects resulting from multiprogramming and high program load (paging) cannot be modeled adequately. Benchmars To determine the real performance, we have to measure real programs. A benchmar is a program or a set of programs that represent a typical load profile (worload). Barry Linnert, linnert@inf.fu-berlin.de, Betriebssysteme WS 05/6-0

Application-specific Benchmars Since the performance requirements are different in different areas of computing, application specific benchmars have proven useful. Example Linpac Dedicated to scientific computing. High fraction of floating point operations. Most of the time are spent in BLAS subroutines (Basic Linear Algebra Subpacage). Dhrystone Specialized for system software. Many procedure calls, many string operations. Good for integer performance. I/O- and floating-point performance are not covered. Debit-Credit Benchmar Dedicated to transaction systems (Baning applications) SPEC Benchmar Suite (Systems Performance Evaluation Cooperative) Sort of standard, which leading manufacturers have agreed on. Measures primarily CPU performance (integer and floating-point). Consists of 0 selected applications from science and engineering. Barry Linnert, linnert@inf.fu-berlin.de, Betriebssysteme WS 05/6 -

Benchmar Comparison Barry Linnert, linnert@inf.fu-berlin.de, Betriebssysteme WS 05/6 From: Weicer, R.P.: An Overview of Common Benchmars. IEEE Computer, Dec. 990 -

SPEC-Benchmar Original SPEC-Benchmar: The current SPEC CPU006 suite includes applications from these areas: AI game theory bioinformatics chemistry compilers interpreters data compression fluid dynamics physics speech recognition video processing weather prediction Barry Linnert, linnert@inf.fu-berlin.de, Betriebssysteme WS 05/6-3

SPEC-Benchmar Meanwhile, SPEC is only the umbrella organization, under which different groups are developing specific benchmars: Open Systems Group (OSG) High Performance Group (HPC) Graphics Performance Group (GPG) Currently, SPEC benchmars are available for: CPU, Graphics, MPI/OMP, Java Client/Server, Mail Server, NFS, Power, SIP, SOA, Virtualization, Web Servers Barry Linnert, linnert@inf.fu-berlin.de, Betriebssysteme WS 05/6-4

Performance evaluation a priori To assess and evaluate strategy variants during the design phase, we cannot rely on measurements since the system does not exist yet. Frequently, we also want to abstract from machine details to exclude side effects. In this case we have to model the system and its behavior. To do this, we have two alternatives: Analytical models The system behavior is described by mathematical quantities and functional relations between them. Simulation models The computing system with all its components and its behavior is simulated on the computer. Barry Linnert, linnert@inf.fu-berlin.de, Betriebssysteme WS 05/6-5

Simulation vs. Analytical Modeling Simulation models are almost unlimited concerning their accuracy and their application areas. Modeling can be done with an arbitrary level of detail. The cost is correspondingly high: The development of the simulation models is costly. Carrying out simulations runs is extremely compute intensive. To find out the functional relationship between two system quantities, we need to perform a complete set of simulation runs. Analytical models rely on assumptions that in real world are often not met (e.g. assumptions about distributions). The computational overhead is very low compared to simulation. Functional relationships can be derived directly from the model. The application range is limited due to the mathematical assumptions. Barry Linnert, linnert@inf.fu-berlin.de, Betriebssysteme WS 05/6-6

. Queuing models: Introduction Queuing models consist of one or more service stations that are built in the following way: Arrival stream ( Arrival behavior) Queue (Strategy) An arrival stream, described by the distribution of the interarrival time, feeds an input queue with objects that may be customers, requests, processes, pacets etc. depending on the application. From there the customers get to one of the identical service stations or servers, if it is idle. The selection from the queue is done according to some given strategy. The time the customer spends at the service station is described by the probability distribution of the service time.. c Server (service time) Barry Linnert, linnert@inf.fu-berlin.de, Betriebssysteme WS 05/6-7

Characterization of queuing systems To describe a given queuing system, the major parameters are composed in the following characteristic way (Kendall's notation): A B c K P S The letters have the following meaning: A: Distribution of the interarrival time B: Distribution of the service time c: Number of service stations K: Capacity of queue P: Size of population (maximum number of customers) S: Selection strategy Barry Linnert, linnert@inf.fu-berlin.de, Betriebssysteme WS 05/6-8

Characterization of queuing systems A: Distribution of the interarrival time Examples: D Deterministic M Marov (exponential) E r H r G Erlang stage r Hyperexponential degree r General (unspecified) A B c K P S B: Distribution of the service time Possible specifications as with A S: Selection strategy Examples: FCFS First Come First Served LCFS Last Come First Served PS Processor Sharing Barry Linnert, linnert@inf.fu-berlin.de, Betriebssysteme WS 05/6-9

Characterization of queuing systems Usually, the parameters queue size K and population P are not limited. In those cases the quantities are not indicated. If nothing is said about S, the assumption is FCFS (default strategy). A B c K P S Typical descriptions are: D D M M c M M K E r M M G c G G M M 3 0 000 FCFS Barry Linnert, linnert@inf.fu-berlin.de, Betriebssysteme WS 05/6-0

Important quantities Number quantities (stochastic variables) m number of customers in the queue u n number of customers currently being served number of customers in the system. 3 m u n Barry Linnert, linnert@inf.fu-berlin.de, Betriebssysteme WS 05/6 -

Important quantities Time quantities (stochastic variables) a interarrival time w b r waiting time (time spent in queue) service time (time spent at service station) response time (time spent in the system), a..a. residence time preceding arrival arrival start of service end of service a w b time r Rates (Parameter of distribution) λ arrival rate (E[a]/λ) µ service rate (E[b]/µ) Barry Linnert, linnert@inf.fu-berlin.de, Betriebssysteme WS 05/6 -

Elementary relations Stability criterion If c denotes the number of service stations (or simply: servers) the following must hold: λ < c µ "On the average, not more customers may arrive than can be processed ( served)" Especially in systems with only one server (c ) we use : λ /µ (traffic intensity) We get as stability condition: < Barry Linnert, linnert@inf.fu-berlin.de, Betriebssysteme WS 05/6-3

Elementary relations If the stability criterion is violated, we get (in case of unlimited population and unlimited queue size) infinite queue lengths (m ). By limiting the input buffer (queue), however, the system remains (mathematically) stable. If there is a buffer overflow, customers (requests) get lost. Barry Linnert, linnert@inf.fu-berlin.de, Betriebssysteme WS 05/6-4

Elementary relations Numbers The following holds: m + u n The number of requests in the system is composed of the number in the queue and the number in service. This also holds for the expectations: E[m] + E[u] E[n] Times The following holds: : w + b r The response time is composed of waiting time and service time. E[w] + E[b] E[r] If the service rate is independent of the queue length, the additive relation is also applicable to the variances: var[m] + var[u] var[n] and var[w] + var[b] var[r] Barry Linnert, linnert@inf.fu-berlin.de, Betriebssysteme WS 05/6-5

Little s Law Relation between numbers and times in arbitrary (sub)systems Mean number arrival rate x mean residence time Arrival rate number Leaves the system Idea for proof: If you loo at the system exactly when a requests leaves, then there are in the system exactly those that have arrived during the residence time of the leaving request. The number of requests in the system is N, and the number of requests arrived during a period R divided by R is the arrival rate. By taing the average we get the above relation. Barry Linnert, linnert@inf.fu-berlin.de, Betriebssysteme WS 05/6-6

Little s Law We observe the system over a long interval [0,T]. Arrival Request Arrival Request Departure Request Arrival Request 3 Departure Request Departure Request 3 0 3 4 5 6 7 8 time A(t): D(t): Number arrivals in [0,t], t<t Number departures in [0,t], t<t Due to the stability condition the following approximately holds: A(T) D(T). We obtain as arrival rate: Arrival rate A(T) / T D(T) / T Departure rate Barry Linnert, linnert@inf.fu-berlin.de, Betriebssysteme WS 05/6-7

Little s Law Moreover, we get for the number of requests N(t) in the system: N(t) A(t) D(t) 5 Request number 4 3 Arrivals A 3 Number in system N Departures D time 3 4 5 6 7 8 time 3 4 5 6 7 8 The filled area in both diagrams has the same size. It can be calculated as J T 0 N and indicates the accumulated residence time of all requests in the system. Barry Linnert, linnert@inf.fu-berlin.de, Betriebssysteme WS 05/6 T ( t ) dt A( t ) D ( t ) dt A( t ) dt D ( t )dt 0 T 0 T 0-8

Little s Law J can be obtained also this way (see diagram at the right): J ( ) A T R i i Dividing J by the number of arrived (or departed) requests yields the mean residence (response) time: R J A( T ) 4 3 response time R 3 request number We obtain as the mean number of requests in the system: N N T ( ) ( t ) dt A T J T A( T ) This last equation is again Little's Law. Barry Linnert, linnert@inf.fu-berlin.de, Betriebssysteme WS 05/6 T 0 J T -9

Little s Law Mean number arrival rate mean residence time The law is applicable for the complete queuing station: E[n] λ E[r] number in system arrival rate response time for the server alone: E[u] λ E[b] number in service arrival rate service time for the queue: E[m] λ E[w] number in queue arrival rate waiting time Barry Linnert, linnert@inf.fu-berlin.de, Betriebssysteme WS 05/6-30

.3 Stochastic Processes If we loo at a system quantity such as the queue length m at different times, we will observe different values. They can be regarded as stochastic variables over the time. Let T be a set and let X(t) be a stochastic variable for each t T. The collection of all stochastic variables X(t), t T is called a stochastic process. Types of stochastic processes: If the set of values that X(t) can tae is finite or countable, the process is called discrete-state, otherwise continuous-state. If the set T is finite or countable, the process is called discretetime, otherwise continuous-time. Barry Linnert, linnert@inf.fu-berlin.de, Betriebssysteme WS 05/6-3

Examples discrete-state continuous-state state state continuoustime discretetime time time state state time time Barry Linnert, linnert@inf.fu-berlin.de, Betriebssysteme WS 05/6-3

Marov Process Definition A stochastic process {X(t), t T } is called Marov process, if for each subset of n+ values t < t <... < t n+ of the index set T and for each set of n+ states {x, x,... x n+ } the following holds: P [ X ( tn + ) xn + X ( t) x, X ( t ) x,..., X ( tn ) xn ] X ( t ) x X ( t ) x P [ ] n + n + n n That means that for a Marov process the next state only depends on the current state independent of from where we entered that state. The complete history of the process is condensed or summarized in the current state. A discrete-state Marov process is also called Marov chain. State Past X(t n )x n Future time t n Barry Linnert, linnert@inf.fu-berlin.de, Betriebssysteme WS 05/6-33

Marov Chains A Marov chain switches states at some times. If the probability for the state change does not depend on the time, the chain is called homogeneous. A homogeneous Marov chain can be described by its state change behavior. We denote with q ij the transition rate from state i into state j. The Marov chain can be represented as a (possibly infinite) graph with the states as vertices and the possible transitions as edges. Under some assumptions the process shows a so-called stationary behavior, i.e. for t the process exhibits an "average" behavior that is independent of its initial state. Then we can calculate the probability that the process is in some state i. q 4 q 4 q 64 q 3 q 4 q 5 5 3 q 53 q 56 q 36 6 Barry Linnert, linnert@inf.fu-berlin.de, Betriebssysteme WS 05/6-34

Special Marov Chains If in a discrete, one-dimensional state space only transitions between neighboring states are possible the Marov chain is called birth-anddeath process. The birth-and-death (BD) process can be described by the following state diagram: λ 0 λ λ λ 3 λ 4 λ 5 λ 6 0 µ µ µ 3 3 µ 4 4 µ 5 5 µ 6 6 µ 7 The λ i are called birth rates, the µ i are death rates. Applying BD processes to queuing systems the λ i are called arrival rates, the µ i are service rates. The state space may be finite or infinite. There are also pure birth processes (µ i 0 i ) and pure death processes (λ i 0 i ). (In queuing systems: arrival process and departure process.) In many cases the rates are independent of the state, i.e. λ i λ i or µ i µ i. Barry Linnert, linnert@inf.fu-berlin.de, Betriebssysteme WS 05/6-35

The Poisson Process (Poisson Stream) The pure birth process counts the births or arrivals, respectively, and is called Poisson Process. Arrivals 0 t Interarrival time A The following properties hold: The probability for an arrival at time t is independent of the time of the previous arrival ( Memorylessness or Marov-property). The interarrival time is exponentially distributed, i.e. λt ( ) e A t The number of arrivals (state of Poisson Process) X(t) in interval [0,t] follows a Poisson distribution, i.e. P [ X ( t ) ] ( λt ) t! e λ Barry Linnert, linnert@inf.fu-berlin.de, Betriebssysteme WS 05/6-36

Poisson Streams Joint of Poisson Streams If several Poisson arrival streams are combined, the resulting combined process is again a Poisson process with rate λ i For of Poisson Streams If a Poisson stream fors into several substreams with foring probabilities p i, pi, the resulting substreams are also of Poisson type and the following holds: Departures If a M M -Station is fed by a Poisson stream then the departure stream is also of Poisson type. Barry Linnert, linnert@inf.fu-berlin.de, Betriebssysteme WS 05/6 λ λ piλ i i λ λ λ λ λ λ λ p p p λ λ λ -37

.4 The M M -Station The birth-and-death process exactly describes the behavior of the most simple service station, the M M -Station. λ 0 λ λ λ 3 λ 4 λ 5 λ 6 0 µ µ µ 3 3 µ 4 4 µ 5 5 µ 6 6 µ 7 The state of the process indicates the number N of requests at the station. The following generally holds for the BD-process: P 0 [ ] N π π for > 0 The idle probability π 0 follows from the normalization condition: i 0 π i π λ µ λ µ 0 + λ µ 0 λi i 0 µ i + Barry Linnert, linnert@inf.fu-berlin.de, Betriebssysteme WS 05/6-38

Steady state probabilities λ λ λ λ λ λ λ 0 3 4 5 6 µ µ µ µ µ µ µ If all rates are constant (λ i λ, µ i µ) we get: λ µ [ ] π π0 P N with Usually, we set : λ/µ and call traffic intensity. Then we have: π0 For stability reasons we require: <, i.e. λ < µ. Then we get for the state probabilities λ λ + i µ i 0 µ The number of requests in the system in a M M -Station is therefore geometrically distributed. π [ ] π ( ) P N 0 λ µ Barry Linnert, linnert@inf.fu-berlin.de, Betriebssysteme WS 05/6-39

Other Quantities Once we now the distribution, we can compute many relevant quantities: Mean number of requests in the system: λ [ ] N E N i πi µ λ i 0 Probability that there are at least requests in the system: P i [ N ] π ( ) i i Mean response time Using Little s formula we obtain the mean response time from the mean number of requests: N N λ R R λ λ Utilization defined as the probability that the system is woring: [ system not idle] 0 η P π ( ) µ ( ) µ λ Barry Linnert, linnert@inf.fu-berlin.de, Betriebssysteme WS 05/6-40

Quantities as Functions of Utilization π Distribution N Mean number R Mean response time Barry Linnert, linnert@inf.fu-berlin.de, Betriebssysteme WS 05/6-4

Example At a gateway arrive on the average 5 pacets per second. The gateway needs msec to forward a pacet. a) What is the probability for a pacet loss, if the gateway has buffer capacity for exactly 3 pacets? b) How many buffer slots do we need if we want to loose at most one out of one million pacets? Arrival rate λ 5 pps Service rate µ /0.00 500 pps Traffic intensity λ / µ 0.5 State probability P[ Pacets at gateway] 0.75 (0.5) Mean number pacets at gateway: Mean pacet residence time at gateway: Probability for buffer overflow (Pacet loss) Limitation of loss probability to 0-6 : 0 6 log i.e. 0 buffer slots are sufficient. N R µ 0.5 0.75 0.33.66 msec ( ) 500( 0.5) 3 3 8 [ 3] 0.5.49 0 P N 6 ( 0 ) log ( 0 5. ) 9 96. Barry Linnert, linnert@inf.fu-berlin.de, Betriebssysteme WS 05/6-4

Other Quantities Mean number in service U U [ ] 0 π + ( π ) E U 0 0 Mean number in queue M Since the number of request in the station N is composed of the number in service U and the number in the queue M, we get: ( ) M N U N Mean waiting time W The mean waiting time can be obtained by using Little s law : W M / λ λ µ ( ) ( ) Barry Linnert, linnert@inf.fu-berlin.de, Betriebssysteme WS 05/6-43

Other Quantities M W Number in queue Waiting time Barry Linnert, linnert@inf.fu-berlin.de, Betriebssysteme WS 05/6-44

.5 The M M -Station In the M M -Station we have servers that wor in parallel. Each of these servers wors at the same rate.. : If there are or more requests at the station (j ), then all servers are busy and provide a joint service rate of µ. If there are less than requests at the station (j < ), then all these j requests are currently processed, i.e. j servers are busy and provide an accumulated service rate of j µ. Barry Linnert, linnert@inf.fu-berlin.de, Betriebssysteme WS 05/6-45

M M -Station Therefore, the service rate of the M M -station is statedependent: j µ, if j < µ ( j ) µ, if j That leads to the following state transition diagram: λ λ λ λ λ λ λ λ 0 3 - + µ µ 3µ 4µ ( )µ µ µ µ The state probabilities can be derived from the general formula for the BD-process with state-dependent rates: π j λ µ λ µ π j! j! j j 0 π 0 j j < Barry Linnert, linnert@inf.fu-berlin.de, Betriebssysteme WS 05/6-46

M M -Station From these state probabilities we can (with some effort) calculate the mean values of different quantities: using The corresponding times can be derived applying Little s law. -47 Barry Linnert, linnert@inf.fu-berlin.de, Betriebssysteme WS 05/6 0! π µ λ µ λ µ λ + µ λ N 0! π µ λ µ λ µ λ M µ λ µ λ + µ λ π 0 0!! j j j

Example A server wors at a rate of µ. To improve the response times, one ponders the following alternative: Alternative (twice as fast) Replace the server by a new one with double speed, i.e. one with rate of µ. µ Alternative (two servers) Add to the existing server another one with the same speed, such that both can wor in parallel and are fed by a joint input queue. µ. µ Barry Linnert, linnert@inf.fu-berlin.de, Betriebssysteme WS 05/6-48

Which Alternative is better? One server with double speed Two servers with single speed -49 Barry Linnert, linnert@inf.fu-berlin.de, Betriebssysteme WS 05/6 µ µ µ µ + + + + + + T D T D T D T D R R W W N N M M

Comparison of time Waiting times Response times W D W T R T R D The corresponding numbers N and M perform similarly due to Little s law. Barry Linnert, linnert@inf.fu-berlin.de, Betriebssysteme WS 05/6-50

Interpretation The system with two servers has lower waiting times, since for N an arriving requests can be served immediately, while in the system with one double speed server it has to wait. The single double speed server can more than compensate the higher waiting time since a request is served in half the time. The single double speed server delivers its service rate of µ already for N, while the system with two single speed servers only for N and more wors at the rate of µ. λ λ λ λ 0 3 µ µ µ µ Single double speed server 0 3 λ λ λ λ µ µ µ µ two single speed servers Barry Linnert, linnert@inf.fu-berlin.de, Betriebssysteme WS 05/6-5

.6 The M M K-System (limited input buffer) If the system has a bounded queue capacity, arriving requests may be refused due to buffer overflow, i.e. they are lost. N < K µ N K The state space in this case is finite: λ λ λ λ λ 0 3 K µ µ µ µ µ λ µ λ 0 µ 0 0 < K K 0 < K > K, 0 Barry Linnert, linnert@inf.fu-berlin.de, Betriebssysteme WS 05/6-5

The M M K-Station Due to the finiteness of the state space we can drop the stability condition < : For the state probabilities we obtain π 0 K, K + For this leads to an undefined expression. Computing the limit yields (L' Hospital): π 0 K K + From that we can calculate as expectation the mean value: K + N ( K + ) K + Barry Linnert, linnert@inf.fu-berlin.de, Betriebssysteme WS 05/6-53

Loss due to buffer overflow Of particular interest is the loss probability, i.e. the probability that a request is lost: K p L π K K + While at the system with infinite input queue the arrival rate is equal to the departure rate, we have here to consider some loss: λ λ eff µ λ eff λ L The arrival stream splits into an effective stream and a loss or leaage stream: λ λ eff + λ L The loss rate is λ L p L λ Therefore the effective arrival rate is λ eff (-p L ) λ Barry Linnert, linnert@inf.fu-berlin.de, Betriebssysteme WS 05/6-54

Remar Using the M M K-station we can calculate the example of slide -4 more accurately: We found: arrival rate λ 5 pps service rate µ /0.00 500 pps traffic intensity λ / µ 0.5 We wanted to calculate the loss probability for a buffer size of 3. The probability for buffer overflow (pacet loss) was 3 3 8 [ 3] 0.5.49 0 P N This is only an approximate solution since the M M -system can also get into higher states (N>K), while the M M K-system remains in the state K. The M M -system should therefore calculate the loss probability to pessimistically. Actually, we obtain for the M M 3-system a value of 0 5. 3 8 p L π3 0 5.. 0 4 0 5. ( ) Barry Linnert, linnert@inf.fu-berlin.de, Betriebssysteme WS 05/6-55

.7 Closed System with two queuing stations In a multitasing system, for each process we can observe alternating compute phases and I/O phases. The I/O operations can be file accesses or paging activities. Modeling the processor and the dis each as a queuing station we get the following picture: λ λ µ µ Station Station We assume that in this closed system K processes circulate, i.e. K is the multiprogramming degree. The state of the system can be expressed solely by e.g. the number of requests (processes) at the first station, because the number at the second station necessarily results to K-. Barry Linnert, linnert@inf.fu-berlin.de, Betriebssysteme WS 05/6-56

Computing relevant quantities Unnown are the arrival rates at the particular stations. However, the arrival rate at the first station equals the departure rate at the second station, as long as there are requests at the second station (and vice versa): These equations are exactly the same conditions as for the limited M M K-system of the last section. That means that the closed two-station system is exactly described by the equations of slide 0-5 if we write v µ / µ instead of von λ / µ. Interesting is e.g. the utilization of processor and dis: -57 Barry Linnert, linnert@inf.fu-berlin.de, Betriebssysteme WS 05/6 µ λ < 0 K for K [ ] [ ] 0 0 + + π η K K K v v v v v P N N P [ ] [ ] + + + π η K K K K K K v v v v v K P N K P N

Utilization in the -Server System Utilization,0 0,8 K4 K3 K K 0,6 0,4 η η 0, 3 4 5 v Barry Linnert, linnert@inf.fu-berlin.de, Betriebssysteme WS 05/6-58

Modeling paging We now from the discussion of paging that increasing the multiprogramming degree K reduces the number of page frames per process. By that, the time between two page faults gets smaller and smaller. As relationship between the multiprogramming degree and the interpage- fault time we now from empirical studies: t s a M K, where M is the memory size. We now can model this relationship by using a closed two-station system: Let station be the CPU, station the paging device. The interpagefault time can be interpreted as the mean service time of the CPU: t s B / µ µ K C K a M Barry Linnert, linnert@inf.fu-berlin.de, Betriebssysteme WS 05/6-59

Thrashing Utilization of CPU η and dis η.0 0.8 C8 0.6 C64 C6 0.4 3 6 C3 8 C64 0. η η Barry Linnert, linnert@inf.fu-berlin.de, Betriebssysteme WS 05/6 4 6 8 0 Multiprogrammingdegree K -60

Modeling paging We can derive the following: For small K the CPU utilization (η ) increases strongly and stays for some time at a high level. The utilization of the paging dis (η ) is initially very low. With increasing K the dis utilization increases and at the same time the CPU utilization. The processes start to get jammed at the paging dis (thrashing effect). For large values of the constant C ( small memory size) the effect starts early and heavily. If we have more memory available (small C ), we can achieve high CPU utilization also for large numbers of processes K. Barry Linnert, linnert@inf.fu-berlin.de, Betriebssysteme WS 05/6-6

Remars Understanding the single queuing station and applying the formulas can lead to useful insights into the behavior of an operating system. For more complex problems we need to give up the Marov assumption use other strategies as FIFO regard the System to be modeled as a networ of many queuing stations In such cases we may use modeling tools with graphical user interface to describe the system to modeled. Analysis and graphical presentation of the results can be done automatically. Some of these tools allow also the simulative analysis with statistic evaluation. Barry Linnert, linnert@inf.fu-berlin.de, Betriebssysteme WS 05/6-6

Further references Jain,R.: The Art of Computer Performance Analysis, John Wiley, 99 Kleinroc, L.: Queuing Systems, Vol.+, John Wiley, 975 Trivedi, K.: Probability and Statistics with Reliability, Queuing and Computer Science Applications, John Wiley, 00 Weicer, R.P.: An Overview of Common Benchmars. IEEE Computer, Dec. 990 Haverort, B.: Performance of Computer Communication Systems, John Wiley, 998 Zeigler, B. et al.: Theory of Modeling and Simulation (nd ed.) Academic Press, 000 Barry Linnert, linnert@inf.fu-berlin.de, Betriebssysteme WS 05/6-63