CPE 619 MonitorsPart II: Measurement Techniques and ToolsOutlineMonitorsSlide 5TerminologyTerminology (cont’d)Monitor ClassificationSlide 9Software MonitorsIssues in Software Monitor Design - Activation MechanismIssues in Software Monitor Design – Buffer SizeIssues in Software Monitor Design – Number of BuffersIssues in Software Monitor Design – Buffer OverflowIssues in Software Monitor Design – MiscSlide 16Hardware MonitorsSoftware vs. Hardware MonitorsFirmware and Hybrid MonitorsSlide 20Monitoring Distributed SystemsLayered ViewComponents of a Distributed Systems MonitorObservation (1 of 2)Observation (2 of 2)CollectionAnalysisPresentation (1 of 2)Presentation (2 of 2)Interpretation and ConsoleReal-World ExamplesPerformance TuningMeasuring Execution TimeUsing the date CommandUsing the time CommandUsing the clock() FunctionUsing the gettimeofday() functionProgram ProfilingExample: gprofPAPI InterfaceTuning ExampleTuning Example (cont’d)Slide 43CPE 619MonitorsAleksandar MilenkovićThe LaCASA LaboratoryElectrical and Computer Engineering DepartmentThe University of Alabama in Huntsvillehttp://www.ece.uah.edu/~milenkahttp://www.ece.uah.edu/~lacasa2Part II: Measurement Techniques and ToolsMeasurements are not to provide numbers but insight - Ingrid BucherMeasure computer system performanceMonitor the system that is being subjected to a particular workloadHow to select appropriate workloadIn general performance analysis should know1. What are the different types of workloads?2. Which workloads are commonly used by other analysts?3. How are the appropriate workload types selected?4. How is the measured workload data summarized?5. How is the system performance monitored?6. How can the desired workload be placed on the system in a controlled manner?7. How are the results of the evaluation presented?3OutlineIntroductionTerminologySoftware MonitorsHardware MonitorsMonitoring Distributed Systems4MonitorsA monitor is a tool used to observe activities on a systemObserve performanceCollect performance statisticsMay analyze the dataMay display resultsMay even suggest remediesMonitors are used not only by performance analystsSystems programmer may profile softwareSystem manager may measure resource utilization to find bottleneckSystem manager may use to tune systemSystem analyst may use to characterize workloadSystem analyst may use to develop models or inputs for modelsThat which is monitored improves. – Source unknown5OutlineIntroductionTerminologySoftware MonitorsHardware MonitorsMonitoring Distributed Systems6TerminologyEvent – a change in the system stateE.g.: cache miss, page fault, process context switch, beginning of seek on a disk, arrival of a packet, Trace – a log of events, usually including the time of the event, and other important parametersOverhead – most monitors perturb the system operationUse CPU or storage; Sometimes called artifact. Goal is to minimize artifactDomain – the set of activities observable by the monitorE.g.: accounting logs record information about CPU time, number of disks, terminals, networks, paging I/O’s, the number of characters transferred among disks, terminals, networks, and paging devices7Terminology (cont’d)Input rate – the maximum frequency of events that monitor can correctly observeBurst mode: the rate at which an event can occur for a short period of timeSustained mode: the rate the monitor can tolerate for long durationsResolution – coarseness of the information observedInput width – the number of bits recorded for each event. Input rate x width = storage required8Monitor ClassificationImplementation levelSoftware, Hardware, Firmware, HybridTrigger mechanismEvent driven – activated only by occurrence of certain events; Low overhead for rare event, but higher if event is frequentSampling (timer driven) – activated at fixed time intervals by clock interruptsIdeal for frequent eventsDisplayOn-line – provide data continuously. E.g.: tcpdumpBatch – collect data for later analysis. E.g.: gprof.9OutlineIntroductionTerminologySoftware MonitorsHardware MonitorsMonitoring Distributed Systems10Software MonitorsMonitor operating systems, and higher level software, e.g., networks, databasesAt each activation, several instructions are executedIn general, only suitable for low frequency event or overhead becomes too highOverhead may be OK if timing does not need to be preserved; Lower input rates, lower resolutions, and higher overhead than hardwareBut, they have higher input widths, higher recording capacitiesEasier to develop and modify11Issues in Software Monitor Design - Activation MechanismHow to trigger the data collection routine?1) Trap – instrument the system software with trap instructions at appropriate points. Collect data. Like a subroutine.E.g.: to measure I/O service time, trap before I/O service routine and record time, trap after, take diff2) Trace – each instruction is followed by data collection routine (trace mode). Enormous overhead. Time insensitive.E.g., instruction-trace monitor to produce a PC histogram3) Timer interrupt – a timer interrupt service provided by the OS is used to transfer control to a data collection routine at fixed intervals. Overhead is independent of the event rateIf sampling counter, beware of overflows12Issues in Software Monitor Design – Buffer SizeStore recorded data in buffers in memory, which are later written to hard diskBuffers should be large To minimize the need to write frequently to hard disk Buffers should be smallDon’t have a lot of overhead when write to diskDoesn’t impact performance of system (or reduced memory availability is not observable)Optimal buffer size is a function of the input rate, input width, and emptying rate13Issues in Software Monitor Design – Number of BuffersUsually organized in a ringAllows recording (buffer-emptying) process to proceed at a different rate than monitoring (buffer-filling) processMonitoring may be burstySince cannot read while process is writing, a minimum of two buffers required for concurrent accessMay be circular for writing so monitor overwrites last if recording process too slowMay compress to reduce space, but adds overhead14Issues in Software Monitor Design –
View Full Document