find model parameters, to validate models, and to develop inputs for models. c 1994 Raj Jain 7.1



Similar documents
PART IV Performance oriented design, Performance testing, Performance tuning & Performance solutions. Outline. Performance oriented design

Operating Systems 4 th Class

Chapter 3 Operating-System Structures

Chapter 2 System Structures

What is LOG Storm and what is it useful for?

Gigabit Ethernet Packet Capture. User s Guide

Contributions to Gang Scheduling

CS161: Operating Systems

Advanced Computer Architecture-CS501. Computer Systems Design and Architecture 2.1, 2.2, 3.2

Chapter 2 Basic Structure of Computers. Jin-Fu Li Department of Electrical Engineering National Central University Jungli, Taiwan

An Implementation Of Multiprocessor Linux

11.1 inspectit inspectit

CSC 2405: Computer Systems II

In-memory Tables Technology overview and solutions

SQL Server 2012 Optimization, Performance Tuning and Troubleshooting

Computer-System Architecture

COS 318: Operating Systems

Introduction to Embedded Systems. Software Update Problem

Transactional Memory

OPERATING SYSTEM - VIRTUAL MEMORY

Introduction. Part I: Finding Bottlenecks when Something s Wrong. Chapter 1: Performance Tuning 3

Users are Complaining that the System is Slow What Should I Do Now? Part 1

SAN Conceptual and Design Basics

Real-Time Scheduling 1 / 39

How to read this guide

Chapter 6, The Operating System Machine Level

Chapter 11 I/O Management and Disk Scheduling

Eight Ways to Increase GPIB System Performance

Operating Systems: Basic Concepts and History

Exceptions in MIPS. know the exception mechanism in MIPS be able to write a simple exception handler for a MIPS machine

Microsoft SQL Server: MS Performance Tuning and Optimization Digital

Overlapping Data Transfer With Application Execution on Clusters

ABAP SQL Monitor Implementation Guide and Best Practices

1. Computer System Structure and Components

Compute Cluster Server Lab 3: Debugging the parallel MPI programs in Microsoft Visual Studio 2005

Monitoring PostgreSQL database with Verax NMS

SQL Server Performance Tuning and Optimization

The Art of Workload Selection

Lesson Objectives. To provide a grand tour of the major operating systems components To provide coverage of basic computer system organization

Optimizing Performance. Training Division New Delhi

AXI Performance Monitor v5.0

Basics of VTune Performance Analyzer. Intel Software College. Objectives. VTune Performance Analyzer. Agenda

Performance Counters. Microsoft SQL. Technical Data Sheet. Overview:

Full and Para Virtualization

evm Virtualization Platform for Windows

Chapter 2 Logic Gates and Introduction to Computer Architecture

DB2 for Linux, UNIX, and Windows Performance Tuning and Monitoring Workshop

Introduction. What is an Operating System?

Technical Properties. Mobile Operating Systems. Overview Concepts of Mobile. Functions Processes. Lecture 11. Memory Management.

Communication Protocol

CS 377: Operating Systems. Outline. A review of what you ve learned, and how it applies to a real operating system. Lecture 25 - Linux Case Study

TRACE PERFORMANCE TESTING APPROACH. Overview. Approach. Flow. Attributes

Reconfigurable Architecture Requirements for Co-Designed Virtual Machines

CS 6290 I/O and Storage. Milos Prvulovic

Virtualization. Pradipta De

Selection of Techniques and Metrics

The Complete Performance Solution for Microsoft SQL Server

CHAPTER 4 MARIE: An Introduction to a Simple Computer

Q. Consider a dynamic instruction execution (an execution trace, in other words) that consists of repeats of code in this pattern:

Debugging A MotoHawk Application using the Application Monitor

Remote Copy Technology of ETERNUS6000 and ETERNUS3000 Disk Arrays

ELEC 377. Operating Systems. Week 1 Class 3

Windows Server Performance Monitoring

Processes and Non-Preemptive Scheduling. Otto J. Anshus

Test Driven Development of Embedded Systems Using Existing Software Test Infrastructure

- An Essential Building Block for Stable and Reliable Compute Clusters

A High Resolution Performance Monitoring Software on the Pentium

Tivoli IBM Tivoli Web Response Monitor and IBM Tivoli Web Segment Analyzer

Guideline for stresstest Page 1 of 6. Stress test

Enterprise Manager Performance Tips

theguard! ApplicationManager System Windows Data Collector

ENEA BARE METAL PERFORMANCE TOOLS FOR NETLOGIC XLP AND CAVIUM OCTEON PLUS

The IntelliMagic White Paper on: Storage Performance Analysis for an IBM San Volume Controller (SVC) (IBM V7000)

AQA GCSE in Computer Science Computer Science Microsoft IT Academy Mapping

x86 ISA Modifications to support Virtual Machines

Chapter 3: Operating-System Structures. System Components Operating System Services System Calls System Programs System Structure Virtual Machines

Contents. Digital Video Surveillance Basic Troubleshooting Guide

Java DB Performance. Olav Sandstå Sun Microsystems, Trondheim, Norway Submission ID: 860

Processor Architectures

Geospatial Server Performance Colin Bertram UK User Group Meeting 23-Sep-2014

OPTIMIZE DMA CONFIGURATION IN ENCRYPTION USE CASE. Guillène Ribière, CEO, System Architect

PRODUCTIVITY ESTIMATION OF UNIX OPERATING SYSTEM

Cover. SEB SIMOTION Easy Basics. Collection of standardized SIMOTION basic functions. FAQ April Service & Support. Answers for industry.


11.1. Performance Monitoring

Operating Systems. Lecture 03. February 11, 2013

İSTANBUL AYDIN UNIVERSITY

UNIT 2 CLASSIFICATION OF PARALLEL COMPUTERS

Windows 2003 Performance Monitor. System Monitor. Adding a counter

Flash for Databases. September 22, 2015 Peter Zaitsev Percona

Operating System Structures

Practical Performance Understanding the Performance of Your Application

MCTS Guide to Microsoft Windows 7. Chapter 10 Performance Tuning

Last Class: OS and Computer Architecture. Last Class: OS and Computer Architecture

Traditional IBM Mainframe Operating Principles

Bandwidth Calculations for SA-1100 Processor LCD Displays

"Charting the Course... MOC AC SQL Server 2014 Performance Tuning and Optimization. Course Summary

Introduction to Virtual Machines

ICOM 6005 Database Management Systems Design. Dr. Manuel Rodríguez Martínez Electrical and Computer Engineering Department Lecture 2 August 23, 2001

MySQL performance in a cloud. Mark Callaghan

Transcription:

Monitors Monitor: A tool used to observe the activities on a system. Usage: A system programmer may use a monitor to improve software performance. Find frequently used segments of the software. A systems manager may use a monitor to measure resource utilizations and to find the performance bottleneck. A systems manager may also use a monitor to tune the system. A systems analyst may use a monitor to characterize the workload. A systems analyst may use a monitor to find model parameters, to validate models, and to develop inputs for models. c 1994 Raj Jain 7.1

Monitor Terminology Event: A change in the system state is called an event. Examples: process context switching, beginning of seek on a disk, and arrival of a packet. Trace: A log of events Overhead: Artifact Domain: The set of activities observable by the monitor. Input Rate: The maximum frequency of events that a monitor can correctly observe. Burst-mode rate: the rate at which an event can occur for a short duration. Sustained rate: Can tolerate for long durations. Resolution: The coarseness of the information observed is called the c 1994 Raj Jain 7.2

resolution. For example, record time only in units of 16 milliseconds. Input Width: The number of bits of information recorded on a event is called the input width. c 1994 Raj Jain 7.3

Monitor Classification Implementation: Software monitor Hardware monitor Firmware monitor Hybrid monitor Trigger Mechanism: Event-driven: Good for rare events. Timer-driven (sampling monitor): Good for frequent events. By result display ability: On-line monitors: display the system state continuously Batch monitors: collect the data that can be analyzed later. Example: A particular monitor may be classified as a hybrid-sampling-batch c 1994 Raj Jain 7.4

monitor. c 1994 Raj Jain 7.5

Software Monitors Used for operating systems and higher level software such as networks and databases. Suitable only if the input rate is low. Also used if overhead is not an issue. For example, in an instruction-tracing monitor, every single-user instruction executed may be interrupted. Compared to H/W monitor: Lower input rates Lower resolutions Higher overhead Higher input widths Higher recording capacities Easier to develop Easier to modify c 1994 Raj Jain 7.6

Issues in Software-Monitor Design 1. Activation Mechanism: (a) Trap instruction (b) Trace mode (c) Timer interrupt 2. Buffer Size: Large Too much time per write Small Too many write operations Optimum = function of input rate, input width, and the emptying rate. 3. Number of Buffers: Minimum two. More to allow varying 4. Buffer Overflow: Overwrite: old info is lost Block: new info is lost c 1994 Raj Jain 7.7

In any case, record buffer overflows. Similarly, counters can be stuck-at or zeroed on overflow. 5. Data Compression or Analysis: Process the data as it is observed Reduces the space required. Increases the overhead. 6. On/Off Switch: Use conditional (IF... THEN...) Reduces overhead Helps during development and debugging. 7. Language: Use the same language as the system 8. Priority: Should not affect system operations Low priority for the monitor c 1994 Raj Jain 7.8

Timely recording High priority 9. Abnormal-Events Monitoring: Should observe normal as well as abnormal events. For example: System initialization Device failures Program failures. 10. Users prefer to monitor abnormal events: Abnormal events occur at a lower rate and impose less monitoring overhead Abnormal events help the user take preventive action c 1994 Raj Jain 7.9

Hardware Monitors Separate equipment attached to the system being monitored via probes. No system resources consumed in monitoring Higher input rate Less chances of introducing bugs into the system operation Components: 1. Probes 2. Counters 3. Logic Elements: AND, OR, and other logic gates. 4. Comparators: To compare counters or signal values with preset values. 5. Mapping Hardware: Allows histograms c 1994 Raj Jain 7.10

6. Timer: For time-stamping or sampling 7. Tape/Disk: To store the data Probe-point libraries: A list of points on the system where the probes can be attached. c 1994 Raj Jain 7.11

Software vs. Hardware Monitors Criterion Hardware Monitor Software Monitor Domain Input Rate Difficult to monitor operating system events. Sampling rates of 10 5 per second possible. Difficult to monitor hardware events unless recognizable by an instruction. Sampling rate limited by the processor MIPS and overhead required. Time Resolution 10 ns is possible. Generally 10 to 16 ms. Expertise Recording Capacity Input Width Requires intimate knowledge of hardware. Limited by memory and secondary storage. Not a problem currently. Can record several simultaneous events. Requires intimate knowledge of software. Limited by overhead desired. Can t record several simultaneous events unless there are multiple processors. Monitor Overhead None Overhead depends upon the input rate and input width. Less than 5% adequate and more than 100% possible. Portability Generally portable. Specific to an operating system. Availability Errors Monitoring continues even during system malfunction or failure. Possible to connect the probes to wrong points. Cost High Medium Can t monitor during system crash. Once debugged, errors are rare. c 1994 Raj Jain 7.12

Firmware Monitors Implemented by modifying the processor microcode. For applications that fall in between the software and hardware monitoring boundaries. Similar to software monitors. Tighter timing limitations Very limited data reduction, if any. Examples: Network interfaces microprogrammed to monitor all traffic on the network Address profiles of microcode (micro-pc histograms) c 1994 Raj Jain 7.13

Hybrid Monitors Combination of software, hardware, or firmware Hardware data-gathering + software data-reduction Example: Dimond monitor by Hughes (1980) Hardware part can observe all traffic on the system bus. Software part can read instruction addresses, processor modes, and system and user identifications. Two parts can communicate through device status and control registers. c 1994 Raj Jain 7.14

Program-Execution Monitors Software monitors designed to observe application software. Purpose: Tracing: To find the execution path of a program. Timing: To find the time spent in various modules of the program. Tuning: To find the most frequent or most time-consuming sections of the code. Assertion Checking: To verify the relationships assumed among the variables of a program. Coverage Analysis: To determine the adequacy of a test run. Criteria for Program Selection: Time critical: to find out where the time c 1994 Raj Jain 7.15

is being spent. Freqeuncy of use: high frequency programs should be optimized first. Percentage of resources: to optimize Most expensive resource should be optimized first. c 1994 Raj Jain 7.16

Steps in Program-Execution Monitoring Figure?? c 1994 Raj Jain 7.17

Issues in Designing a Program-Execution Monitor All issues in s/w monitor design apply. Program Execution Specific: 1. Measurement Unit: modules, subroutines, high-level language statements, or machine instruction. 2. Measurement Technique: tracing (traps) or sampling 3. Instrumentation Mechanism: Instrumentation added before/during/after compilation or during run time. By augmenting the source code, the compiler-generated object code, the run-time environment, the operating system, or the hardware. 4. Profile Report: c 1994 Raj Jain 7.18

Show a frequency and time histogram. Summaries by modules, procedurs, statements. Show self-time and inherited time Allow limiting or expanding the detail (zoom-in or zoom-out) c 1994 Raj Jain 7.19

Techniques for Improving Program Performance Code optimization I/O optimization, Blocking I/Os Changing the file-access method Caching or prefetching data. Paging optimization. Box 7.1 Techniques for Improving Program Performance c 1994 Raj Jain 7.20

1. Optimize the common case. The most frequently used path should also be the most efficient. A procedure should handle all cases correctly and common cases efficiently. 2. Arrange a series of IF statements so that the most likely value is tested first. 3. Arrange a series of AND conditions so that the condition most likely to fail is tested first. 4. Arrange entries in a table so that the most frequently sought values are the first to be compared. 5. Structure the main line of the program so that it contains the most frequent path of the program. Errors and exceptions should be handled separately. 6. Question the necessity of each instruction in the main path (time-critical or most frequent) path of the code. 7. Trade memory space for processor time wherever possible. If a function is computed more than once, compute it once and store the result. Some functions with parameters can be replaced by a table of precomputed values. 8. Use hints. Keeping a fast but possibly inaccurate hint along with a slow but robust algorithm may save time in most cases. 9. Cache the data that is accessed often. However, one must ensure that there is sufficient locality before using caches. 10. Unroll short loops. Save the cost of modifying and testing loop indexes. 11. Replace searches by direct indexing, wherever possible. In some cases, this may require more space than minimum. 12. Use the same size for data fields that need to be compared or added together. 13. Use the full word widths of the computer to evaluate expressions. For example, use 32 bits on a 32-bit computer even if you need only 31. 14. Align data fields on word boundaries, wherever possible. 15. Evaluate items only when needed, particularly if it is likely that it will not be needed. Continued on the next page... c 1994 Raj Jain 7.21

Box 7.1 Techniques for Improving Program Performance (Continued) 16. Initialize data areas during run time only when used. Wherever possible, the values should be initialized at the compile time. 17. Use algebraic identities to simplify conditional expressions. 18. Replace threshold tests on monotone (continuously nondecreasing or continuously nonincreasing) functions by tests on their parameters, thereby, avoiding the evaluation of the function. 19. Evaluate variables not changing in a loop before entering the loop. 20. Combine two nearby loops if they use the same set of conditions. 21. Use shifts in place of multiplication and division by powers of two. 22. Keep the code simple. Simpler programs are more efficient. 23. Block I/O requests together to reduce the number of I/O operations. 24. Preload small disk files into tables in memory. 25. Use multiple buffers for files to allow prefetching. 26. Link the most frequently used procedures together to maximize the locality of reference. 27. Reference data in the order stored. Arrays stored by columns should be referenced by columns. 28. Store data elements, that are used concurrently together. 29. Store subroutines in sequence so that calling and called subroutines will be loaded together. 30. Align I/O buffers to page boundaries. 31. Open files, which are used together, in sequence so that buffers will be located together. 32. Pass simple subroutine arguments by value rather than by reference, wherever possible. 33. Pass large arrays and other data structures to subroutines by reference rather than value. 34. Separate read-only code areas from read-write data areas to minimize the number of page-writes. c 1994 Raj Jain 7.22

Exercises 7.1 For each of the following measurements list the type of the monitor that can and cannot be used. Which type of monitor would you prefer and why. a. Interrupt response time b. Instruction opcode frequency c. Program reference pattern d. Virtual memory reference pattern in a multiprogramming system e. CPU time required to send one packet on a network f. Response time for a database query 7.2 For each of the following environments, describe how you would implement a monitor to produce a program counter histogram: a. Using a H/W monitor c 1994 Raj Jain 7.23

b. Using a S/W monitor on an IBM PC with CPU having a trace-bit. c. Using a S/W monitor on a TRS-80 TM with CPU not having a trace-bit. c 1994 Raj Jain 7.24