46
Chapter 3 System Performance and Models

Chapter 3 System Performance and Models. 2 Systems and Models The concept of modeling in the study of the dynamic behavior of simple system is be able

Embed Size (px)

Citation preview

Page 1: Chapter 3 System Performance and Models. 2 Systems and Models The concept of modeling in the study of the dynamic behavior of simple system is be able

Chapter 3System Performance

and Models

Page 2: Chapter 3 System Performance and Models. 2 Systems and Models The concept of modeling in the study of the dynamic behavior of simple system is be able

2

Systems and Models• The concept of modeling in the study of the

dynamic behavior of simple system is be able to calculating their performances.

• System is the part of the real world under study, which composed of a set of entities interacting among themselves and with the environment.

• A model is an abstract representation of a system.

• The system behavior is dependent on the input data and actions from the environment.

Page 3: Chapter 3 System Performance and Models. 2 Systems and Models The concept of modeling in the study of the dynamic behavior of simple system is be able

3

Abstraction• The most important concept in analysis and

design• It hide nonessential properties and behavior of

the system so the model is used to describe, study, and/or design the system.

• A high-level description of a collection of objects• Only the relevant properties and features of the

objects are included.

Page 4: Chapter 3 System Performance and Models. 2 Systems and Models The concept of modeling in the study of the dynamic behavior of simple system is be able

4

SystemA system has:• Structure• BehaviorThe model of a system is simpler than the real

system in its structure and behavior. But it should be equivalent to the system.

Page 5: Chapter 3 System Performance and Models. 2 Systems and Models The concept of modeling in the study of the dynamic behavior of simple system is be able

5

Using Models

A user can:• Manipulate the model by supplying it with a

set of inputs• Observe its behavior and/or measure its

output when given some input/output.• Predict the behavior of the real system by

analyzing the behavior of the model under the same circumstances.

Page 6: Chapter 3 System Performance and Models. 2 Systems and Models The concept of modeling in the study of the dynamic behavior of simple system is be able

6

Types of ModelThe most general categories of models are:• Physical models (scale models) is resemble the physical

attributes of an actual object by scaling down the physical system.

• Graphical models use graphical representations to display the behavior of a system.

• Mathematical models is a set of Mathematical expression and logical relations to express the relationships among the entities of objects of the system.

• Models are the most flexible ones and are the ones studied here.

Page 7: Chapter 3 System Performance and Models. 2 Systems and Models The concept of modeling in the study of the dynamic behavior of simple system is be able

7

Mathematical Models

• Analytic, the solution is a set of expressions that define the behavior of the model.

• Numeric, mathematical techniques are used to derive values for the model behavior within given intervals.

• Deterministic and stochastic models are solved with numerical techniques.

Page 8: Chapter 3 System Performance and Models. 2 Systems and Models The concept of modeling in the study of the dynamic behavior of simple system is be able

8

Other Categories of ModelsModels are further categorized as:• Deterministic - models that display a completely

predictable behavior (with 100% certainty)• Stochastic - models that display some level of

uncertainty in their behavior. This random behavior is implemented with random variables.

• Most simulation models are stochastic because the real systems being modeled, they exhibit inherent uncertainty properties.

Page 9: Chapter 3 System Performance and Models. 2 Systems and Models The concept of modeling in the study of the dynamic behavior of simple system is be able

9

Stochastic Models• A stochastic model is one which includes some

uncertainty in its behavior.• One or more attributes (implemented as random

variables) change value according to some probability distribution.

• Example of random variables in the simple batch OS model:– Inter-arrival time of jobs – CPU service time of jobs

Page 10: Chapter 3 System Performance and Models. 2 Systems and Models The concept of modeling in the study of the dynamic behavior of simple system is be able

10

Model of a Simple Batch System

Page 11: Chapter 3 System Performance and Models. 2 Systems and Models The concept of modeling in the study of the dynamic behavior of simple system is be able

Performance Metrics• Performance Metrics is measurement or

quantity that helps characterize, together with other performances metrics, to show the effectiveness of the system.

The result of running a performance model shows the values of the performance metrics.

• Average wait time – period that jobs wait in the system since their arrival time.

• Average Throughput – the average number of jobs completed in some specific time

Page 12: Chapter 3 System Performance and Models. 2 Systems and Models The concept of modeling in the study of the dynamic behavior of simple system is be able

Relevant Performance Measures•CPU utilization•Resource Utilization•Average response time•Average turnaround time•Availability•Reliability•Capacity•Fairness•Speedup

Page 13: Chapter 3 System Performance and Models. 2 Systems and Models The concept of modeling in the study of the dynamic behavior of simple system is be able

13

Efficiency and Reliability

• The efficiency of a system is the ratio usable capacity to nominal capacity

• The reliability of a system is measured by the probability of errors. Also defined as the mean time between errors.

• Availability is the fraction of time that the system is available for user requests, also called the system uptime.

Page 14: Chapter 3 System Performance and Models. 2 Systems and Models The concept of modeling in the study of the dynamic behavior of simple system is be able

14

Simulation Models

• A simulation model is a mathematical model implemented with a general-purpose programming language, or a simulation language.

• A simulation run is an experiment carried out for some observation period and with the simulation model to study the behavior of the model.

Page 15: Chapter 3 System Performance and Models. 2 Systems and Models The concept of modeling in the study of the dynamic behavior of simple system is be able

15

Simulation Models cont.

Simulation model divided into two categories:•Continuous models change their state continuously with time. Mathematical notation is used to completely define the behavior. For example, the free-falling object.•Discrete models only change their state at discrete instants. For example, arrival of a job in the Simple batch OS model.

Page 16: Chapter 3 System Performance and Models. 2 Systems and Models The concept of modeling in the study of the dynamic behavior of simple system is be able

16

Model of a Simple Batch System

Job arrive at discrete points , request memory & CPU service

The job must be wait for the input Queue

At later time some jobs receives some amount of CPU time.

Page 17: Chapter 3 System Performance and Models. 2 Systems and Models The concept of modeling in the study of the dynamic behavior of simple system is be able

17

Simulation Results

For every simulation run there are two types of output:

• Trace - sequence of events that occur during the simulation period

• Performance measures – summarizes the statistics of the simulation run.

Page 18: Chapter 3 System Performance and Models. 2 Systems and Models The concept of modeling in the study of the dynamic behavior of simple system is be able

18

Performance: Internal Goals

• Performance Goals for sub-systems that are internal to the computer(s)

• Examples– Maximize CPU Utilization

• % time CPU is busy– Maximize Disk Utilization

• % time Disk is busy– Minimize Disk Access Time

• Time it takes to perform a disk request

Page 19: Chapter 3 System Performance and Models. 2 Systems and Models The concept of modeling in the study of the dynamic behavior of simple system is be able

19

Workload on a System

• The workload on the system is the performance measures depend on the current workload of the system– The workload for a system can be characterized by

another series of measures, which are made on the input to the system

– Errors in characterizing the workload may have serious consequences.

Page 20: Chapter 3 System Performance and Models. 2 Systems and Models The concept of modeling in the study of the dynamic behavior of simple system is be able

20

Meaning of Performance Measures

• The average number of jobs in the system• The average number of jobs in the queue(s) (i.e., that are

waiting)• The average time that a job spends in the system• The average time that a job spends in the queue(s)• The CPU utilization• Throughput - the total number of jobs serviced.

Page 21: Chapter 3 System Performance and Models. 2 Systems and Models The concept of modeling in the study of the dynamic behavior of simple system is be able

21

Arrival Interval & Rate

• Arrival Interval is the time between 2 resource requests arriving

• Arrival Rate = 1 / Arrival Interval– How often requests for a resource arrive– Denoted by λ (Means on a combinations of dependent variables)

Page 22: Chapter 3 System Performance and Models. 2 Systems and Models The concept of modeling in the study of the dynamic behavior of simple system is be able

22

Service Time & Rate

• Service Time is the time to actually perform a request– e.g. 500 Msec / request

• Service Rate = 1 / Service Time– Denoted by μ– e.g. 2 requests / second

Page 23: Chapter 3 System Performance and Models. 2 Systems and Models The concept of modeling in the study of the dynamic behavior of simple system is be able

23

System Capacity

• The capacity of a system is determined by its maximum performance

• The nominal capacity of a system is given by the maximum achievable throughput under ideal conditions

• The usable capacity is the maximum throughput achievable under specified constraints.

Page 24: Chapter 3 System Performance and Models. 2 Systems and Models The concept of modeling in the study of the dynamic behavior of simple system is be able

24

Bottleneck

• The computer system reaches capacity when one or more of its servers or resources reach a utilization close to 100%.

• The bottleneck of the system will be localized in the server or resource with a utilization close to 100%, while the other servers and resources each have utilization significantly below 100%.

Page 25: Chapter 3 System Performance and Models. 2 Systems and Models The concept of modeling in the study of the dynamic behavior of simple system is be able

25

Modeling Bottleneck

The bottleneck of the computer system described here can be localized at the processor, the queue, or the memory. – The queue may become full (reaches capacity) very

often as the processor utilization increases. – The memory capacity may also be used at capacity

(100%). – Thus, in any of the three cases, the processor, the

queue, or the memory will need to be replaced or increased in capacity.

Page 26: Chapter 3 System Performance and Models. 2 Systems and Models The concept of modeling in the study of the dynamic behavior of simple system is be able

Chapter 4Systems with

Multiprogramming

Abraham Siberschatz, Peter Galvin, & Greg Gagne From Operating Systems Concepts Textbook

Abraham Siberschatz, Peter Galvin, & Greg Gagne From Operating Systems Concepts Textbook

Page 27: Chapter 3 System Performance and Models. 2 Systems and Models The concept of modeling in the study of the dynamic behavior of simple system is be able

27

Multiprogramming• An operating system can support several

processes in memory. • While one process receives service from the

CPU, another process receives service from an I/O device and the other processes are waiting in some queues.

• The number of processes that the system supports is called the degree of multiprogramming.

Page 28: Chapter 3 System Performance and Models. 2 Systems and Models The concept of modeling in the study of the dynamic behavior of simple system is be able

28

Multi-Programming

• In most computer systems, the I/O controllers enable a system to overlap device I/O operation with processor (CPU) operation.

• This results in a more efficient utilization of the system facilities

• Several processes can be in memory at a time, one receiving CPU service and another receiving I/O service.

Page 29: Chapter 3 System Performance and Models. 2 Systems and Models The concept of modeling in the study of the dynamic behavior of simple system is be able

29

A More Complete Model of a Computer System

• One process receives service from CPU

• Another process receiving service from an I/O

• Other processes are waiting in the queues

All occurs the same time

Page 30: Chapter 3 System Performance and Models. 2 Systems and Models The concept of modeling in the study of the dynamic behavior of simple system is be able

30

Requirements for Multiprogramming

• The OS must allocate the CPU and other resources to the various processes in such a way that the CPU and other active resources are maintained busy the longest period possible.

• If there is only one CPU in the system, then only one process can be in execution at any given time.

• The other processes are ready, waiting for CPU service. Processes also request access to passive resources, such as memory locations.

Page 31: Chapter 3 System Performance and Models. 2 Systems and Models The concept of modeling in the study of the dynamic behavior of simple system is be able

31

Process Service Requests

• A process requests CPU and I/O services at various times and usually will have to wait for these services.

• The OS maintains a waiting line or queue of processes for every one of these services.

• At some point in time, the process will be in a queue waiting for CPU service. At some other point in time, the process will be in a different queue waiting for I/O service.

• When the process completes all service requests, it terminates and exits the system.

Page 32: Chapter 3 System Performance and Models. 2 Systems and Models The concept of modeling in the study of the dynamic behavior of simple system is be able

32

Process Management - Review• Process management is one of the major functions of

the operating system; it involves creating processes and controlling their execution.

• In most operating systems, several processes are stored in memory at the same time and the operating system (OS) manages the sharing of the CPU and other resources among the various processes.

• This technique in the operating system is called multiprogramming.

Page 33: Chapter 3 System Performance and Models. 2 Systems and Models The concept of modeling in the study of the dynamic behavior of simple system is be able

33

System with Multiples Stations

1. MM allocates memory to the waiting jobs in the input queue.

2. Ready queue and the CPU provide CPU service to the process waiting in the ready queue

3. I/O queue & I/O device that provide service to the processes waiting in the equivalent I/O queue.

Page 34: Chapter 3 System Performance and Models. 2 Systems and Models The concept of modeling in the study of the dynamic behavior of simple system is be able

34

Service Demand • The total CPU and I/O service requirements called

Service demand.Service demands is a process is divided into shorter CPU

and I/O requests• A process will require several CPU and I/O bursts. • Each CPU request is called a CPU burst• Each I/O request is called an I/O burst• In normal processing of a process, it alternates from a

CPU burst to an I/O burst and repeats

Page 35: Chapter 3 System Performance and Models. 2 Systems and Models The concept of modeling in the study of the dynamic behavior of simple system is be able

35

CPU Service

• The total CPU service demand for a process is the sum of all its CPU bursts

• Each CPU burst has a different duration • The total CPU service requested by process Pi

is: i = 1 + 2 + ... m

Page 36: Chapter 3 System Performance and Models. 2 Systems and Models The concept of modeling in the study of the dynamic behavior of simple system is be able

36

Batch OS with I/O

Page 37: Chapter 3 System Performance and Models. 2 Systems and Models The concept of modeling in the study of the dynamic behavior of simple system is be able

37

Context Switch• Context Switch are an inherent characteristics

of multiprogramming, changeover from the current process being executed to the next process to execute.

• This process is saved in its descriptor or program control block (PCB) and the context of next process is loaded from it PCB.

• Context switch time is overhead time• Time is dependent on hardware support

Page 38: Chapter 3 System Performance and Models. 2 Systems and Models The concept of modeling in the study of the dynamic behavior of simple system is be able

38

Components of Simulation Model

• The active resources of the system are modeled as active objects

• The environment is modeled as an active object because the environment generates the jobs that will arrive into the system/model

• The processes are also modeled as active objects --- they arrive requesting resources and services

• The other system resources are modeled as passive objects (memory, queues, etc)

Page 39: Chapter 3 System Performance and Models. 2 Systems and Models The concept of modeling in the study of the dynamic behavior of simple system is be able

39

Classes Defined in the Models• A class for active objects is a class that inherits

class Process, which is a Psim library class• A class for passive objects can be any other

class • The processes, each one representing a

computational unit to be serviced in the computer system, under control of the operating system. The processes are implemented as active objects of class Job.

Page 40: Chapter 3 System Performance and Models. 2 Systems and Models The concept of modeling in the study of the dynamic behavior of simple system is be able

40

Classes and Objects in the Simulation Model

• The environment, which generates the arriving processes. This is an active object of class Arrivals. This object creates instances of class Job according to the inter-arrival period.

• The CPU, which represents the processor that provides CPU service (execution) to the processes according to their service demands. The CPU is an active object of class Processor.

Page 41: Chapter 3 System Performance and Models. 2 Systems and Models The concept of modeling in the study of the dynamic behavior of simple system is be able

41

Processes and Multiprogramming

• Processes are program instances• Several processes can be active at a time (O.S

with multiprogramming)

• Only one process is actually running at any instant of time

• The CPU switches from one process to another rapidly (context switching)

• The selection of which process to run next is made by the scheduler

Page 42: Chapter 3 System Performance and Models. 2 Systems and Models The concept of modeling in the study of the dynamic behavior of simple system is be able

42

Random Variables

• Random variables are used in the model to represent several parameters and each random variable is derived from a specific probability distribution.

• The inter-arrival periods are generated from an exponential distribution.

• The CPU and I/O service periods, also known as service demands, each generated from an exponential distribution.

• The memory demands for the processes are generated from a uniform distribution.

Page 43: Chapter 3 System Performance and Models. 2 Systems and Models The concept of modeling in the study of the dynamic behavior of simple system is be able

43

First Part of Output of A Simulation Run

Psim/Java project: System with Multiprogramming - CPU and I/OSimulation date: 2/18/2005 17:34Ave. (mean) inter-arrival per.: 2.3 mean CPU service per.: 18.5; mean I/O service per.: 18.75Min memory req.: 10, Max memory req: 65Total system memory: 512Degree of multiprogramming: 20; Queue size: 125

Job1 requiring service 5.456 arrives at time 0.721Processor starting CPU burst of Job1 at 0.721Processor completed CPU burst of Job1 at 2.752I/O dev starting I/O burst of Job1 at 2.752I/O dev completed burst Job1 at 4.811Processor starting CPU burst of Job1 at 4.811Processor completed CPU burst of Job1 at 6.092. . .

Page 44: Chapter 3 System Performance and Models. 2 Systems and Models The concept of modeling in the study of the dynamic behavior of simple system is be able

44

Summary of OutputSimulation closing at: 811.1911086822296Memory usage: 0.9150302684027927 avg num items used: 476.90258114299934

End Simulation of System with Multiprogramming - CPU and I/O servers, clock: 811.1911086822296Results of simulation: -----------------------------------------------------Service factor: 0.048Total number of jobs that arrived: 231Total number of rejected jobs: 56Throughput: 44Maximum number of jobs in memory: 20Proportion rejected/arrived jobs: 0.242Proportion of rejected/completed jobs: 1.273Average job wait period: 177.092Processor utilization: 0.969I/O dev utilization: 0.935

Page 45: Chapter 3 System Performance and Models. 2 Systems and Models The concept of modeling in the study of the dynamic behavior of simple system is be able

45

A System with no Multiprogramming

• The C++ simulation model for the batch operating system with I/O is implemented in file batchmio.cpp

• Only one process is allowed to be stored in memory at a time. The degree of multiprogramming is set to 1

• All processes request a certain amount of memory a ( passive resource), a CPU burst, an I/O burst, and finally, another CPU burst.

Page 46: Chapter 3 System Performance and Models. 2 Systems and Models The concept of modeling in the study of the dynamic behavior of simple system is be able

1. When any changes happened on memory allocation, it will effect the performances, such as decrease and increase utilization;2. Any changes occurs on the parameters, it will effect work load average mean, Jobs arrival mean, average mean CPUs. service request fluctuate (Decrease and Increase on the parameter).3. Work load parameters effect processor utilization changes4. adding memory size, implies that we are requesting more job to be service and process utilization will reduce because time of CPU will be divided to more services request.