performance measurements of computer systems: tools and...

69
Performance measurements of computer systems: tools and analysis M2R PDES Jean-Marc Vincent and Arnaud Legrand Laboratory LIG MESCAL Project Universities of Grenoble {Jean-Marc.Vincent,Arnaud.Legrand}@imag.fr December 16, 2015 J.-M. Vincent and A. Legrand Performance measurements 1 / 59

Upload: others

Post on 27-Mar-2021

3 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Performance measurements of computer systems: tools and ...polaris.imag.fr/arnaud.legrand/teaching/2015/M2R_EP_measurements.pdf\API-based" Monitoring Examples Indirect Metrics J.-M

Performance measurements of computer systems:tools and analysis

M2R PDES

Jean-Marc Vincent and Arnaud Legrand

Laboratory LIGMESCAL Project

Universities of Grenoble{Jean-Marc.Vincent,Arnaud.Legrand}@imag.fr

December 16, 2015

J.-M. Vincent and A. Legrand Performance measurements 1 / 59

Page 2: Performance measurements of computer systems: tools and ...polaris.imag.fr/arnaud.legrand/teaching/2015/M2R_EP_measurements.pdf\API-based" Monitoring Examples Indirect Metrics J.-M

Outline

1 Introduction, Definitions, ClassificationsPerformance MetricFinding BottlenecksMonitors & Measurements

2 Monitoring ExamplesMeasuring Time: Practical ConsiderationsSequential Program Execution Monitoring: Profiling“API-based” Monitoring ExamplesIndirect Metrics

J.-M. Vincent and A. Legrand Performance measurements 2 / 59

Page 3: Performance measurements of computer systems: tools and ...polaris.imag.fr/arnaud.legrand/teaching/2015/M2R_EP_measurements.pdf\API-based" Monitoring Examples Indirect Metrics J.-M

Outline

1 Introduction, Definitions, ClassificationsPerformance MetricFinding BottlenecksMonitors & Measurements

2 Monitoring ExamplesMeasuring Time: Practical ConsiderationsSequential Program Execution Monitoring: Profiling“API-based” Monitoring ExamplesIndirect Metrics

J.-M. Vincent and A. Legrand Performance measurements Definitions 3 / 59

Page 4: Performance measurements of computer systems: tools and ...polaris.imag.fr/arnaud.legrand/teaching/2015/M2R_EP_measurements.pdf\API-based" Monitoring Examples Indirect Metrics J.-M

Outline

1 Introduction, Definitions, ClassificationsPerformance MetricFinding BottlenecksMonitors & Measurements

2 Monitoring ExamplesMeasuring Time: Practical ConsiderationsSequential Program Execution Monitoring: Profiling“API-based” Monitoring ExamplesIndirect Metrics

J.-M. Vincent and A. Legrand Performance measurements Definitions 4 / 59

Page 5: Performance measurements of computer systems: tools and ...polaris.imag.fr/arnaud.legrand/teaching/2015/M2R_EP_measurements.pdf\API-based" Monitoring Examples Indirect Metrics J.-M

Performance Metric

Metrics are criteria to compare the performances of a system.In general, the metrics are related to speed, accuracy, reliability andavailability of services.The basic characteristics of a computer system that we typicallyneed to measure are:

I a count of how many times an event occurs,

I the duration of some time interval, and

I the size of some parameter.

From these types of measured values, we can derive the actual valuethat we wish to use to describe the system: the performance metric.

J.-M. Vincent and A. Legrand Performance measurements Definitions 5 / 59

Page 6: Performance measurements of computer systems: tools and ...polaris.imag.fr/arnaud.legrand/teaching/2015/M2R_EP_measurements.pdf\API-based" Monitoring Examples Indirect Metrics J.-M

Performance Metric Characterization

Reliability A system A always outperforms a system B ⇔ the performancemetric indicates that A always outperforms B.

Repeatability The same value of the metric is measured each time thesame experiments is performed.

Consistency Units of the metrics and its precise definition are the sameacross different systems and different configurations of the same system.

Linearity The value of the metric should be linearly proportional to theactual performance of the machine.

Easiness of measurement If a metric is hard to measure, it is unlikely any-one will actually use it. Moreover it is more likely to be incorrectlydetermined.

Independence Metrics should not be defined to favor particular systems.

Many metrics do not fulfill these requirements.

J.-M. Vincent and A. Legrand Performance measurements Definitions 6 / 59

Page 7: Performance measurements of computer systems: tools and ...polaris.imag.fr/arnaud.legrand/teaching/2015/M2R_EP_measurements.pdf\API-based" Monitoring Examples Indirect Metrics J.-M

Performance as Time

I Time between the start and the end of an operationI Also called running time, elapsed time, wall-clock time, response

time, latency, execution time, ...I Most straightforward measure: “my program takes 12.5s on a

Pentium 3.5GHz”I Can be normalized to some reference time

I Must be measured on a “dedicated” machine

J.-M. Vincent and A. Legrand Performance measurements Definitions 7 / 59

Page 8: Performance measurements of computer systems: tools and ...polaris.imag.fr/arnaud.legrand/teaching/2015/M2R_EP_measurements.pdf\API-based" Monitoring Examples Indirect Metrics J.-M

Performance as Rate

Used often so that performance can be independent on the “size”of the application (e.g., compressing a 1MB file takes 1 minute.compressing a 2MB file takes 2 minutes ; the performance is thesame).

MIPS Millions of instructions / sec = instruction countexecution time×106 = clock rate

CPI×106 .But Instructions Set Architectures are not equivalent

I 1 CISC instruction = many RISC instructionsI Programs use different instruction mixesI May be ok for same program on same architectures

MFlops Millions of floating point operations /secI Very popular, but often misleadingI e.g., A high MFlops rate in a stupid algorithm could have poor application

performance

Application-specificI Millions of frames rendered per secondI Millions of amino-acid compared per secondI Millions of HTTP requests served per seconds

Application-specific metrics are often preferable and others maybe misleading

J.-M. Vincent and A. Legrand Performance measurements Definitions 8 / 59

Page 9: Performance measurements of computer systems: tools and ...polaris.imag.fr/arnaud.legrand/teaching/2015/M2R_EP_measurements.pdf\API-based" Monitoring Examples Indirect Metrics J.-M

“Peak” Performance?

Resource vendors always talk about peak performance rate

I Computed based on specifications of the machineI For instance:

I I build a machine with 2 floating point unitsI Each unit can do an operation in 2 cyclesI My CPU is at 1GHzI Therefore I have a 1*2/2 =1GFlops Machine

I Problem:I In real code you will never be able to use the two floating point

units constantlyI Data needs to come from memory and cause the floating point

units to be idle

Typically, real codes achieve only an (often small) fraction of thepeak performance

J.-M. Vincent and A. Legrand Performance measurements Definitions 9 / 59

Page 10: Performance measurements of computer systems: tools and ...polaris.imag.fr/arnaud.legrand/teaching/2015/M2R_EP_measurements.pdf\API-based" Monitoring Examples Indirect Metrics J.-M

Benchmarks

I Since many performance metrics turn out to be misleading,people have designed benchmarks

I Example: SPEC BenchmarkI Integer benchmarkI Floating point benchmark

I These benchmarks are typically a collection of several codesthat come from “real-world software”

I The question “what is a good benchmark” is difficultI A benchmark is representative of a given workload.I If the benchmarks do not correspond to what you’ll do with the

computer, then the benchmark results are not relevant to you

I Other typical benchmarksI Livermore loops, NAS kernels, LINPACK, stream, . . .I SPEC SFS, SPECWeb, . . .

J.-M. Vincent and A. Legrand Performance measurements Definitions 10 / 59

Page 11: Performance measurements of computer systems: tools and ...polaris.imag.fr/arnaud.legrand/teaching/2015/M2R_EP_measurements.pdf\API-based" Monitoring Examples Indirect Metrics J.-M

How About GHz?

I This is often the way in which people say that a computer isbetter than another

I More instruction per seconds for higher clock rate

I Faces the same problems as MIPSProcessor Clock Rate SPEC FP2000 Benchmark

IBM Power3 450 MHz 434

Intel PIII 1.4 GHz 456

Intel P4 2.4GHz 833

Itanium-2 1.0GHz 1356

I But somehow usable within a specific architecture

I Remember that if multi-cores, cache size, frequency scalingcome into the picture...

J.-M. Vincent and A. Legrand Performance measurements Definitions 11 / 59

Page 12: Performance measurements of computer systems: tools and ...polaris.imag.fr/arnaud.legrand/teaching/2015/M2R_EP_measurements.pdf\API-based" Monitoring Examples Indirect Metrics J.-M

Outline

1 Introduction, Definitions, ClassificationsPerformance MetricFinding BottlenecksMonitors & Measurements

2 Monitoring ExamplesMeasuring Time: Practical ConsiderationsSequential Program Execution Monitoring: Profiling“API-based” Monitoring ExamplesIndirect Metrics

J.-M. Vincent and A. Legrand Performance measurements Definitions 12 / 59

Page 13: Performance measurements of computer systems: tools and ...polaris.imag.fr/arnaud.legrand/teaching/2015/M2R_EP_measurements.pdf\API-based" Monitoring Examples Indirect Metrics J.-M

Why is Performance Poor?

Performance is poor because the code suffers from a performancebottleneckDefinition:

I An application runs on a platform that has many components(CPU, Memory, Operating System, Network, Hard Drive, VideoCard, etc.)

I Pick a component and make it faster

I If the application performance increases, that component wasthe bottleneck!

J.-M. Vincent and A. Legrand Performance measurements Definitions 13 / 59

Page 14: Performance measurements of computer systems: tools and ...polaris.imag.fr/arnaud.legrand/teaching/2015/M2R_EP_measurements.pdf\API-based" Monitoring Examples Indirect Metrics J.-M

Removing a Bottleneck

There are two may approaches to remove a bottleneck:

Brute force Hardware Upgrade

I Is sometimes necessaryI But can only get you so far and may be very costly (e.g.,

memory technology)

Modify the code

I The bottleneck is there because the code uses a “resource”heavily or in non-intelligent manner

I We will learn techniques to alleviate bottlenecks at the soft-ware level

J.-M. Vincent and A. Legrand Performance measurements Definitions 14 / 59

Page 15: Performance measurements of computer systems: tools and ...polaris.imag.fr/arnaud.legrand/teaching/2015/M2R_EP_measurements.pdf\API-based" Monitoring Examples Indirect Metrics J.-M

Identifying a Bottleneck

I It can be difficultI You’re not going to change the memory bus just to see what

happens to the applicationI But you can run the code on a different machine and see what

happens

I One ApproachI Know/discover the characteristics of the machineI Instrument the code with time measurements everywhereI Observe the application execution on the machineI Tinker with the codeI Run the application againI RepeatI Reason about what the bottleneck is

J.-M. Vincent and A. Legrand Performance measurements Definitions 15 / 59

Page 16: Performance measurements of computer systems: tools and ...polaris.imag.fr/arnaud.legrand/teaching/2015/M2R_EP_measurements.pdf\API-based" Monitoring Examples Indirect Metrics J.-M

Outline

1 Introduction, Definitions, ClassificationsPerformance MetricFinding BottlenecksMonitors & Measurements

2 Monitoring ExamplesMeasuring Time: Practical ConsiderationsSequential Program Execution Monitoring: Profiling“API-based” Monitoring ExamplesIndirect Metrics

J.-M. Vincent and A. Legrand Performance measurements Definitions 16 / 59

Page 17: Performance measurements of computer systems: tools and ...polaris.imag.fr/arnaud.legrand/teaching/2015/M2R_EP_measurements.pdf\API-based" Monitoring Examples Indirect Metrics J.-M

Monitor

A Monitor is a tool to observe the activities on a system. In general,a monitor:

1 makes measurements on the system (Observation)2 collects performance statistics (Collection),3 analyzes the data (Analysis),4 displays results (Presentation).

Why do we want a monitor ?I A programmer wants to find frequently used segments of a program

to optimize them.I A system administrator wants to measure resource utilization to find

performance bottlenecks.I A system administrator wants to tune the system and measure the im-

pact of system parameters modifications on the system performance.I An analyst wants to characterize the workload. Results may be used

for capacity planning and for creating test workloads.I An analyst wants to find model parameters, to validate models or to

develop inputs for models.

J.-M. Vincent and A. Legrand Performance measurements Definitions 17 / 59

Page 18: Performance measurements of computer systems: tools and ...polaris.imag.fr/arnaud.legrand/teaching/2015/M2R_EP_measurements.pdf\API-based" Monitoring Examples Indirect Metrics J.-M

Monitor Terminology

Event A change in the system state (context switch, seek on a disk,packet arrival, . . . ).

Trace Log of events usually including the time of the events, theirtype and other important parameters.

Overhead Measurement generally induce slight perturbations andconsume system resources (CPU, storage,. . . ).

Domain The set of activities observable by the monitor (CPU time,number of bytes sent on a network card,. . . ).

Input Rate The maximum frequency of events that a monitor cancorrectly observe. One generally distinguishes between burst rateand sustained rate.

Resolution Coarseness of the information observed.

Input Width The number of bits of information recorded on anevent.

Portability Amount of system modifications required to implementthe monitor.

J.-M. Vincent and A. Legrand Performance measurements Definitions 18 / 59

Page 19: Performance measurements of computer systems: tools and ...polaris.imag.fr/arnaud.legrand/teaching/2015/M2R_EP_measurements.pdf\API-based" Monitoring Examples Indirect Metrics J.-M

Events and metrics

The different types of metrics that an analyst may wish to measurecan be classified into the following categories:

Event-count metrics Simply count the number of times a specificevent occurs (e.g., number of page faults, number of disk I/Omade by a program).

Secondary-event metrics These types of metrics record the values ofsome secondary parameters whenever a given event occurs (e.g.,the message size, the time spent in a given function).

Profiles A profile is an aggregate metric used to characterize theoverall behavior of an application program or of an entire system.

J.-M. Vincent and A. Legrand Performance measurements Definitions 19 / 59

Page 20: Performance measurements of computer systems: tools and ...polaris.imag.fr/arnaud.legrand/teaching/2015/M2R_EP_measurements.pdf\API-based" Monitoring Examples Indirect Metrics J.-M

Observation mechanisms

Observation is commonly performed with three mechanisms:

Implicit spying it is sometimes possible to spy the system withoutreally interfering with it (listening on a local Ethernet bus or inwireless environments). Thus, there is almost no impact on theperformance of the system being monitored. Implicit-spying isgenerally used with filters because many observed data are notinteresting.

Explicit Instrumenting By incorporating trace points, probe points,hooks or counters, additional information to implicit-spying canbe obtained. Some systems offer an API to incorporate suchhooks or exports the values of internal counters.

Probing Making requests on the system to estimate its current per-formance.

Some activities can be observed by only one of the three mecha-nisms.

J.-M. Vincent and A. Legrand Performance measurements Definitions 20 / 59

Page 21: Performance measurements of computer systems: tools and ...polaris.imag.fr/arnaud.legrand/teaching/2015/M2R_EP_measurements.pdf\API-based" Monitoring Examples Indirect Metrics J.-M

Activation Mechanisms

Event-driven Record the information whenever a given event occurs. Gen-erally done with counters. The overhead is thus proportional to thefrequency of events.

Tracing Similar to event-driven strategies, except that parts of the systemstate are also recorded. This is thus even more time-consuming andalso also requires much more storage.

Sampling Recording of information occurs periodically. The overhead andthe resolution of the sampling can thus be adjusted. This strategiesproduces a statistical summary of the overall behavior of the system.Events that occurs infrequently may be completely missed. Results mayalso be different from one run to the other.

Indirect An indirect measurement must be used been the metric that isto be determined is not directly accessible (e.g., for portability reasonsor for practical reasons). In this case, one must find another metricthat can be measured directly, from which one can deduce or derivethe desired performance metric.Generally, a model of the system is underlying the deduced metric andthe quality of this model is fundamental.

J.-M. Vincent and A. Legrand Performance measurements Definitions 21 / 59

Page 22: Performance measurements of computer systems: tools and ...polaris.imag.fr/arnaud.legrand/teaching/2015/M2R_EP_measurements.pdf\API-based" Monitoring Examples Indirect Metrics J.-M

Collection

The collection mechanism highly depends on whether we are workingon a on-line monitor (system state is displayed during monitoring)or on a batch monitor (system state is stored for later analysis).Most data need to be recorded in buffers, hence buffer managementissues:

I buffer size is a function of input rate, input width and emptyingrate,

I larger number of buffers allows to cope with variations in fillingand emptying rates,

I buffer overflow management and tracking,

I data compression, on-line analysis,

Abnormal events should also be monitored and even handled athigher priority (low probability ; low overhead, possibility to takepreventive action before the system becomes unavailable).

J.-M. Vincent and A. Legrand Performance measurements Definitions 22 / 59

Page 23: Performance measurements of computer systems: tools and ...polaris.imag.fr/arnaud.legrand/teaching/2015/M2R_EP_measurements.pdf\API-based" Monitoring Examples Indirect Metrics J.-M

Distributed Monitoring Issues

I The problem of communication between m collectors and nobservers often arises.

I We generally resort to hierarchy of collectors/observers for abetter scalability. This intensifies all previous buffer manage-ment issues.

I When collecting data from several observers, clock synchro-nization often becomes an important issue. The tolerance ormaximum allowed clock skew is often related to the round-tripdelay. The larger the system, the more problematic clock skews.

J.-M. Vincent and A. Legrand Performance measurements Definitions 23 / 59

Page 24: Performance measurements of computer systems: tools and ...polaris.imag.fr/arnaud.legrand/teaching/2015/M2R_EP_measurements.pdf\API-based" Monitoring Examples Indirect Metrics J.-M

Presentation

This layer is closely tied to the applications for which the moni-tor is used (performance monitoring, configuration monitoring, faultmonitoring,. . . ).

I Presentation frequency (for on-line monitors).

I Hierarchical representation/aggregation (space/time/states/values).

I Alarm mode (thresholds, abnormal events).

J.-M. Vincent and A. Legrand Performance measurements Definitions 24 / 59

Page 25: Performance measurements of computer systems: tools and ...polaris.imag.fr/arnaud.legrand/teaching/2015/M2R_EP_measurements.pdf\API-based" Monitoring Examples Indirect Metrics J.-M

Measurement Induces Perturbations

I The system resources consumed by the measurement tool itselfas it collects data will strongly affect how much perturbationthe tool will cause in the system.

I Tracing produces the highest level of perturbation (both CPUand disk are used), in particular on time measurements, spa-tial and temporal memory access (cache flush, different pag-ing,. . . ), or on system response time (and thus on workloadcharacterization).

I The largest the overhead, the more likely the system behaviorwill be modified.

Measuring a system alters it

Remain alert to how these perturbations may bias your measure-ments and, ultimately, the conclusions you are able to draw fromyour experiments.

J.-M. Vincent and A. Legrand Performance measurements Definitions 25 / 59

Page 26: Performance measurements of computer systems: tools and ...polaris.imag.fr/arnaud.legrand/teaching/2015/M2R_EP_measurements.pdf\API-based" Monitoring Examples Indirect Metrics J.-M

Outline

1 Introduction, Definitions, ClassificationsPerformance MetricFinding BottlenecksMonitors & Measurements

2 Monitoring ExamplesMeasuring Time: Practical ConsiderationsSequential Program Execution Monitoring: Profiling“API-based” Monitoring ExamplesIndirect Metrics

J.-M. Vincent and A. Legrand Performance measurements Monitoring Examples 26 / 59

Page 27: Performance measurements of computer systems: tools and ...polaris.imag.fr/arnaud.legrand/teaching/2015/M2R_EP_measurements.pdf\API-based" Monitoring Examples Indirect Metrics J.-M

Exercise

Try to find the main characteristics, advantages and drawbacks ofthe following monitors.

J.-M. Vincent and A. Legrand Performance measurements Monitoring Examples 27 / 59

Page 28: Performance measurements of computer systems: tools and ...polaris.imag.fr/arnaud.legrand/teaching/2015/M2R_EP_measurements.pdf\API-based" Monitoring Examples Indirect Metrics J.-M

Outline

1 Introduction, Definitions, ClassificationsPerformance MetricFinding BottlenecksMonitors & Measurements

2 Monitoring ExamplesMeasuring Time: Practical ConsiderationsSequential Program Execution Monitoring: Profiling“API-based” Monitoring ExamplesIndirect Metrics

J.-M. Vincent and A. Legrand Performance measurements Monitoring Examples 28 / 59

Page 29: Performance measurements of computer systems: tools and ...polaris.imag.fr/arnaud.legrand/teaching/2015/M2R_EP_measurements.pdf\API-based" Monitoring Examples Indirect Metrics J.-M

Measuring time by hand?

I One possibility would be to do this by just “looking” at a clock,launching the program, “looking” at the clock again when theprogram terminates

I This of course has some drawbacksI Poor resolutionI Requires the user’s attention

I Therefore operating systems provide ways to time programsautomatically

I UNIX provide the time command

J.-M. Vincent and A. Legrand Performance measurements Monitoring Examples 29 / 59

Page 30: Performance measurements of computer systems: tools and ...polaris.imag.fr/arnaud.legrand/teaching/2015/M2R_EP_measurements.pdf\API-based" Monitoring Examples Indirect Metrics J.-M

The UNIX time Command

I You can put time in front of any UNIX command you invoke

I When the invoked command completes, time prints out timing(and other) information

surf:~$ /usr/bin/X11/time ls -la -R ~/ > /dev/null

4.17user 4.34system 2:55.83elapsed 4%CPU

(0avgtext+0avgdata 0maxresident)k

0inputs+0outputs (0major+1344minor)pagefaults 0swaps

I 4.17 seconds of user timeI 4.34 seconds of system timeI 2 minutes and 55.85 seconds of wall-clock timeI 4% of CPU was usedI 0+0k memory used (text + data)I 0 input, 0 output output (file system I/O)I 1344 minor pagefaults and 0 swaps

J.-M. Vincent and A. Legrand Performance measurements Monitoring Examples 30 / 59

Page 31: Performance measurements of computer systems: tools and ...polaris.imag.fr/arnaud.legrand/teaching/2015/M2R_EP_measurements.pdf\API-based" Monitoring Examples Indirect Metrics J.-M

User, System, Wall-Clock?

surf:~$ /usr/bin/X11/time ls -la -R ~/ > /dev/null

4.17user 4.34system 2:55.83elapsed 4%CPU

(0avgtext+0avgdata 0maxresident)k

0inputs+0outputs (0major+1344minor)pagefaults 0swaps

I User Time: time that the code spends executing user code (i.e.,non system calls)

I System Time: time that the code spends executing system calls

I Wall-Clock Time: time from start to endI Wall-Clock ≥ User + System. Why?

I because the process can be suspended by the O/S due to con-tention for the CPU by other processes

I because the process can be blocked waiting for I/O

J.-M. Vincent and A. Legrand Performance measurements Monitoring Examples 31 / 59

Page 32: Performance measurements of computer systems: tools and ...polaris.imag.fr/arnaud.legrand/teaching/2015/M2R_EP_measurements.pdf\API-based" Monitoring Examples Indirect Metrics J.-M

User, System, Wall-Clock?

surf:~$ /usr/bin/X11/time ls -la -R ~/ > /dev/null

4.17user 4.34system 2:55.83elapsed 4%CPU

(0avgtext+0avgdata 0maxresident)k

0inputs+0outputs (0major+1344minor)pagefaults 0swaps

I User Time: time that the code spends executing user code (i.e.,non system calls)

I System Time: time that the code spends executing system calls

I Wall-Clock Time: time from start to endI Wall-Clock ≥ User + System. Why?

I because the process can be suspended by the O/S due to con-tention for the CPU by other processes

I because the process can be blocked waiting for I/O

J.-M. Vincent and A. Legrand Performance measurements Monitoring Examples 31 / 59

Page 33: Performance measurements of computer systems: tools and ...polaris.imag.fr/arnaud.legrand/teaching/2015/M2R_EP_measurements.pdf\API-based" Monitoring Examples Indirect Metrics J.-M

User, System, Wall-Clock?

surf:~$ /usr/bin/X11/time ls -la -R ~/ > /dev/null

4.17user 4.34system 2:55.83elapsed 4%CPU

(0avgtext+0avgdata 0maxresident)k

0inputs+0outputs (0major+1344minor)pagefaults 0swaps

I User Time: time that the code spends executing user code (i.e.,non system calls)

I System Time: time that the code spends executing system calls

I Wall-Clock Time: time from start to end

I Wall-Clock ≥ User + System. Why?

I because the process can be suspended by the O/S due to con-tention for the CPU by other processes

I because the process can be blocked waiting for I/O

J.-M. Vincent and A. Legrand Performance measurements Monitoring Examples 31 / 59

Page 34: Performance measurements of computer systems: tools and ...polaris.imag.fr/arnaud.legrand/teaching/2015/M2R_EP_measurements.pdf\API-based" Monitoring Examples Indirect Metrics J.-M

User, System, Wall-Clock?

surf:~$ /usr/bin/X11/time ls -la -R ~/ > /dev/null

4.17user 4.34system 2:55.83elapsed 4%CPU

(0avgtext+0avgdata 0maxresident)k

0inputs+0outputs (0major+1344minor)pagefaults 0swaps

I User Time: time that the code spends executing user code (i.e.,non system calls)

I System Time: time that the code spends executing system calls

I Wall-Clock Time: time from start to endI Wall-Clock ≥ User + System. Why?

I because the process can be suspended by the O/S due to con-tention for the CPU by other processes

I because the process can be blocked waiting for I/O

J.-M. Vincent and A. Legrand Performance measurements Monitoring Examples 31 / 59

Page 35: Performance measurements of computer systems: tools and ...polaris.imag.fr/arnaud.legrand/teaching/2015/M2R_EP_measurements.pdf\API-based" Monitoring Examples Indirect Metrics J.-M

User, System, Wall-Clock?

surf:~$ /usr/bin/X11/time ls -la -R ~/ > /dev/null

4.17user 4.34system 2:55.83elapsed 4%CPU

(0avgtext+0avgdata 0maxresident)k

0inputs+0outputs (0major+1344minor)pagefaults 0swaps

I User Time: time that the code spends executing user code (i.e.,non system calls)

I System Time: time that the code spends executing system calls

I Wall-Clock Time: time from start to endI Wall-Clock ≥ User + System. Why?

I because the process can be suspended by the O/S due to con-tention for the CPU by other processes

I because the process can be blocked waiting for I/O

J.-M. Vincent and A. Legrand Performance measurements Monitoring Examples 31 / 59

Page 36: Performance measurements of computer systems: tools and ...polaris.imag.fr/arnaud.legrand/teaching/2015/M2R_EP_measurements.pdf\API-based" Monitoring Examples Indirect Metrics J.-M

User, System, Wall-Clock?

surf:~$ /usr/bin/X11/time ls -la -R ~/ > /dev/null

4.17user 4.34system 2:55.83elapsed 4%CPU

(0avgtext+0avgdata 0maxresident)k

0inputs+0outputs (0major+1344minor)pagefaults 0swaps

I User Time: time that the code spends executing user code (i.e.,non system calls)

I System Time: time that the code spends executing system calls

I Wall-Clock Time: time from start to endI Wall-Clock ≥ User + System. Why?

I because the process can be suspended by the O/S due to con-tention for the CPU by other processes

I because the process can be blocked waiting for I/O

J.-M. Vincent and A. Legrand Performance measurements Monitoring Examples 31 / 59

Page 37: Performance measurements of computer systems: tools and ...polaris.imag.fr/arnaud.legrand/teaching/2015/M2R_EP_measurements.pdf\API-based" Monitoring Examples Indirect Metrics J.-M

Using time

I It’s interesting to know what the user time and the system timeare

I for instance, if the system time is really high, it may be that thecode does too many calls to malloc(), for instance

I But one would really need more information to fix the code (notalways clear which system calls may be responsible for the highsystem time)

I Wall-clock - system - user ' I/O + suspendedI If the system is dedicated, suspended ' 0I Therefore one can estimate the cost of I/OI If I/O is really high, one may want to look at reducing I/O or

doing I/O better

I Therefore, time can give us insight into bottlenecks and givesus wall-clock time

I Measurements should be done on dedicated systems

I time relies on times(2), getrusage(2) and clock(3).

J.-M. Vincent and A. Legrand Performance measurements Monitoring Examples 32 / 59

Page 38: Performance measurements of computer systems: tools and ...polaris.imag.fr/arnaud.legrand/teaching/2015/M2R_EP_measurements.pdf\API-based" Monitoring Examples Indirect Metrics J.-M

User, System, Wall-Clock?

surf:~$ /usr/bin/time ./parallelQuicksort2

9.76user 10.51system 0:06.11elapsed 331%CPU

(0avgtext+0avgdata 158268maxresident)k

0inputs+0outputs (0major+7599minor)pagefaults 0swaps

I Wall-Clock � User + System. Why?

I because there are several processors... the %CPU is simply (User+ System)/Wall-Clock

Beware: The resolution of getrusage is very low (a few ms) soyou can eventually use it to time very large regions of code but nomore.

J.-M. Vincent and A. Legrand Performance measurements Monitoring Examples 33 / 59

Page 39: Performance measurements of computer systems: tools and ...polaris.imag.fr/arnaud.legrand/teaching/2015/M2R_EP_measurements.pdf\API-based" Monitoring Examples Indirect Metrics J.-M

User, System, Wall-Clock?

surf:~$ /usr/bin/time ./parallelQuicksort2

9.76user 10.51system 0:06.11elapsed 331%CPU

(0avgtext+0avgdata 158268maxresident)k

0inputs+0outputs (0major+7599minor)pagefaults 0swaps

I Wall-Clock � User + System. Why?I because there are several processors... the %CPU is simply (User

+ System)/Wall-Clock

Beware: The resolution of getrusage is very low (a few ms) soyou can eventually use it to time very large regions of code but nomore.

J.-M. Vincent and A. Legrand Performance measurements Monitoring Examples 33 / 59

Page 40: Performance measurements of computer systems: tools and ...polaris.imag.fr/arnaud.legrand/teaching/2015/M2R_EP_measurements.pdf\API-based" Monitoring Examples Indirect Metrics J.-M

User, System, Wall-Clock?

surf:~$ /usr/bin/time ./parallelQuicksort2

9.76user 10.51system 0:06.11elapsed 331%CPU

(0avgtext+0avgdata 158268maxresident)k

0inputs+0outputs (0major+7599minor)pagefaults 0swaps

I Wall-Clock � User + System. Why?I because there are several processors... the %CPU is simply (User

+ System)/Wall-Clock

Beware: The resolution of getrusage is very low (a few ms) soyou can eventually use it to time very large regions of code but nomore.

J.-M. Vincent and A. Legrand Performance measurements Monitoring Examples 33 / 59

Page 41: Performance measurements of computer systems: tools and ...polaris.imag.fr/arnaud.legrand/teaching/2015/M2R_EP_measurements.pdf\API-based" Monitoring Examples Indirect Metrics J.-M

Dedicated Systems

I Measuring the performance of a code must be done on a “quies-cent”, “unloaded” machine (the machine only runs the standardO/S processes)

I The machine must be dedicatedI No other user can start a processI The user measuring the performance only runs the minimum

amount of processes (basically, a shell)

I Nevertheless, one should always present measurement resultsas averages over several experiments (because the (small) loadimposed by the O/S is not deterministic)

J.-M. Vincent and A. Legrand Performance measurements Monitoring Examples 34 / 59

Page 42: Performance measurements of computer systems: tools and ...polaris.imag.fr/arnaud.legrand/teaching/2015/M2R_EP_measurements.pdf\API-based" Monitoring Examples Indirect Metrics J.-M

Drawbacks of UNIX time

I The time command has poor resolutionI “Only” millisecondsI Sometimes we want a higher precision, especially if our perfor-

mance improvements are in the 1-2% range

I time times the whole codeI Sometimes we’re only interested in timing some part of the code,

for instance the one that we are trying to optimizeI Sometimes we want to compare the execution time of different

sections of the code

J.-M. Vincent and A. Legrand Performance measurements Monitoring Examples 35 / 59

Page 43: Performance measurements of computer systems: tools and ...polaris.imag.fr/arnaud.legrand/teaching/2015/M2R_EP_measurements.pdf\API-based" Monitoring Examples Indirect Metrics J.-M

Timing with gettimeofday

I gettimeofday from the standard C library

I Measures the number of microseconds since midnight, Jan 1st1970, expressed in seconds and microseconds

struct timeval start;

...gettimeofday(&tv,NULL);

printf("%ld,%ld\n",start.tv sec, start.tv usec);

I Can be used to time sections of codeI Call gettimeofday at beginning of sectionI Call gettimeofday at end of sectionI Compute the time elapsed in microseconds:

(end.tv sec*1000000.0 + end.tv usec -

start.tv sec*1000000.0 - start.tv usec) / 1000000.0)

J.-M. Vincent and A. Legrand Performance measurements Monitoring Examples 36 / 59

Page 44: Performance measurements of computer systems: tools and ...polaris.imag.fr/arnaud.legrand/teaching/2015/M2R_EP_measurements.pdf\API-based" Monitoring Examples Indirect Metrics J.-M

Timing with clock gettime,

I clock gettime (POSIX, linux)

I Measures the number of nanoseconds since midnight, Jan 1st1970, expressed in seconds and microseconds

I Obviously not precise at the nanosecond level but much betterthan gettimeofday

struct timespec tv;

...clock gettime(CLOCK REALTIME,&tv););

I Should be used to time sections of code

J.-M. Vincent and A. Legrand Performance measurements Monitoring Examples 37 / 59

Page 45: Performance measurements of computer systems: tools and ...polaris.imag.fr/arnaud.legrand/teaching/2015/M2R_EP_measurements.pdf\API-based" Monitoring Examples Indirect Metrics J.-M

Other Ways to Time Code

I ntp gettime() (Internet RFC 1589)I Sort of like gettimeofday, but reports estimated error on time

measurementI Not available for all systemsI Part of the GNU C Library

I Java: System.currentTimeMillis()I Known to have resolution problems, with resolution higher than

1 millisecond!I Solution: use a native interface to a better timer

I Java: System.nanoTime()I Added in J2SE 5.0I Probably not accurate at the nanosecond level

I Tons of “high precision timing in Java” on the Web

J.-M. Vincent and A. Legrand Performance measurements Monitoring Examples 38 / 59

Page 46: Performance measurements of computer systems: tools and ...polaris.imag.fr/arnaud.legrand/teaching/2015/M2R_EP_measurements.pdf\API-based" Monitoring Examples Indirect Metrics J.-M

Outline

1 Introduction, Definitions, ClassificationsPerformance MetricFinding BottlenecksMonitors & Measurements

2 Monitoring ExamplesMeasuring Time: Practical ConsiderationsSequential Program Execution Monitoring: Profiling“API-based” Monitoring ExamplesIndirect Metrics

J.-M. Vincent and A. Legrand Performance measurements Monitoring Examples 39 / 59

Page 47: Performance measurements of computer systems: tools and ...polaris.imag.fr/arnaud.legrand/teaching/2015/M2R_EP_measurements.pdf\API-based" Monitoring Examples Indirect Metrics J.-M

Profiling

I A profiler is a tool that monitors the execution of a programand that reports the amount of time spent in different functions

I Useful to identify the expensive functionsI Profiling cycle

I Compile the code with the profilerI Run the codeI Identify the most expensive functionI Optimize that function (i.e. call it less often if possible or make

it faster)I Repeat until you can’t think of any ways to further optimize the

most expensive function

J.-M. Vincent and A. Legrand Performance measurements Monitoring Examples 40 / 59

Page 48: Performance measurements of computer systems: tools and ...polaris.imag.fr/arnaud.legrand/teaching/2015/M2R_EP_measurements.pdf\API-based" Monitoring Examples Indirect Metrics J.-M

Using gprof

I Compile your code using gcc with the -pg option

I Run your code until completion

I Then run gprof with your program’s name as single command-line argument

I Example:gcc -pg prog.c -o prog; ./prog

gprof prog

I The output file contains all profiling information (amount andfraction of time spent in which function)

J.-M. Vincent and A. Legrand Performance measurements Monitoring Examples 41 / 59

Page 49: Performance measurements of computer systems: tools and ...polaris.imag.fr/arnaud.legrand/teaching/2015/M2R_EP_measurements.pdf\API-based" Monitoring Examples Indirect Metrics J.-M

Using gprof

J.-M. Vincent and A. Legrand Performance measurements Monitoring Examples 42 / 59

Page 50: Performance measurements of computer systems: tools and ...polaris.imag.fr/arnaud.legrand/teaching/2015/M2R_EP_measurements.pdf\API-based" Monitoring Examples Indirect Metrics J.-M

Callgrind

I Callgrind is a tool that uses runtime code instrumentation frame-work of Valgrind for call-graph generation

I Valgrind is a kind of emulator or virtual machine.I It uses JIT (just-in-time) compilation techniques to translate

x86 instructions to simpler form called ucode on which varioustools can be executed.

I The ucode processed by the tools is then translated back to thex86 instructions and executed on the host CPU.

I This way even shared libraries and dynamically loaded pluginscan be analyzed but this kind of approach results with huge slowdown (about 50 times for callgrind tool) of analyzed applicationand big memory consumption.

J.-M. Vincent and A. Legrand Performance measurements Monitoring Examples 43 / 59

Page 51: Performance measurements of computer systems: tools and ...polaris.imag.fr/arnaud.legrand/teaching/2015/M2R_EP_measurements.pdf\API-based" Monitoring Examples Indirect Metrics J.-M

Callgrind/Kcachegrind

Data produced by callgrind can be loaded into KCacheGrind tool forbrowsing the performance results.

Valgrind actually includes several tools:

I Memcheck (check the validity of every memory access)

I Cachegrind (memory access profiler/simulator)

I Callgrind (instruction profiler)

I Massif (heap profiler)

I Helgrind (a thread error detector)

J.-M. Vincent and A. Legrand Performance measurements Monitoring Examples 44 / 59

Page 52: Performance measurements of computer systems: tools and ...polaris.imag.fr/arnaud.legrand/teaching/2015/M2R_EP_measurements.pdf\API-based" Monitoring Examples Indirect Metrics J.-M

Callgrind/Kcachegrind

Data produced by callgrind can be loaded into KCacheGrind tool forbrowsing the performance results.

Valgrind actually includes several tools:

I Memcheck (check the validity of every memory access)

I Cachegrind (memory access profiler/simulator)

I Callgrind (instruction profiler)

I Massif (heap profiler)

I Helgrind (a thread error detector)

J.-M. Vincent and A. Legrand Performance measurements Monitoring Examples 44 / 59

Page 53: Performance measurements of computer systems: tools and ...polaris.imag.fr/arnaud.legrand/teaching/2015/M2R_EP_measurements.pdf\API-based" Monitoring Examples Indirect Metrics J.-M

Using perf (Linux profiling with performance counters)

Requires a recent version of linux (≥ 2.6.31...)I Uses special purpose registers on the CPU to count the number

of “events”:I Hardware event: cache miss, branch misspredictionI Software event: page missI Tracepoints, kprobes, and uprobes (trace user-level functions,

which allows for dynamic tracing. . . )I Low overhead, no need to recompile

I sudo perf 4.3 list

I Output can be converted to the callgrind format for visualiza-tion with kcachegrind. Or use custom visualizations (flamegraphs)

J.-M. Vincent and A. Legrand Performance measurements Monitoring Examples 45 / 59

Page 54: Performance measurements of computer systems: tools and ...polaris.imag.fr/arnaud.legrand/teaching/2015/M2R_EP_measurements.pdf\API-based" Monitoring Examples Indirect Metrics J.-M

Beware of benchmarks...

sama:~$ perf 4.3 bench mem all

# Running mem/memcpy benchmark...

Routine default (Default memcpy() provided by glibc)

# Copying 1MB Bytes ...

1.821945 GB/Sec

12.849507 GB/Sec (with prefault)

# Running mem/memset benchmark...

Routine default (Default memset() provided by glibc)

# Copying 1MB Bytes ...

3.170657 GB/Sec

13.377568 GB/Sec (with prefault)

sama:~$ perf 4.3 bench mem all

# Running mem/memcpy benchmark...

Routine default (Default memcpy() provided by glibc)

# Copying 1MB Bytes ...

2.782229 GB/Sec

21.229620 GB/Sec (with prefault)

# Running mem/memset benchmark...

Routine default (Default memset() provided by glibc)

# Copying 1MB Bytes ...

5.548651 GB/Sec

20.345052 GB/Sec (with prefault)

sama:~$ perf 4.3 bench mem all

# Running mem/memcpy benchmark...

Routine default (Default memcpy() provided by glibc)

# Copying 1MB Bytes ...

2.880715 GB/Sec

19.929847 GB/Sec (with prefault)

# Running mem/memset benchmark...

Routine default (Default memset() provided by glibc)

# Copying 1MB Bytes ...

5.425347 GB/Sec

20.777926 GB/Sec (with prefault)

J.-M. Vincent and A. Legrand Performance measurements Monitoring Examples 46 / 59

Page 55: Performance measurements of computer systems: tools and ...polaris.imag.fr/arnaud.legrand/teaching/2015/M2R_EP_measurements.pdf\API-based" Monitoring Examples Indirect Metrics J.-M

Outline

1 Introduction, Definitions, ClassificationsPerformance MetricFinding BottlenecksMonitors & Measurements

2 Monitoring ExamplesMeasuring Time: Practical ConsiderationsSequential Program Execution Monitoring: Profiling“API-based” Monitoring ExamplesIndirect Metrics

J.-M. Vincent and A. Legrand Performance measurements Monitoring Examples 47 / 59

Page 56: Performance measurements of computer systems: tools and ...polaris.imag.fr/arnaud.legrand/teaching/2015/M2R_EP_measurements.pdf\API-based" Monitoring Examples Indirect Metrics J.-M

top

J.-M. Vincent and A. Legrand Performance measurements Monitoring Examples 48 / 59

Page 57: Performance measurements of computer systems: tools and ...polaris.imag.fr/arnaud.legrand/teaching/2015/M2R_EP_measurements.pdf\API-based" Monitoring Examples Indirect Metrics J.-M

How does top get all these information?

It uses /proc!

kanza: $ ldd ‘which top‘

linux-gate.so.1 libproc-3.2.7.so.5libncurses.so libc.so.6

libdl.so.2 /lib/ld-linux.so.2

/proc is a way for the kernel to provide informationabout the status of entries in its process table.On systems where /proc is available, there is no needto instrument the kernel or the application to get theseinformation. Measures are always but it doesn’t meanthat top does not induce perturbations. . . .Other tools (e.g., gkrellm) rely on the same API.

J.-M. Vincent and A. Legrand Performance measurements Monitoring Examples 49 / 59

Page 58: Performance measurements of computer systems: tools and ...polaris.imag.fr/arnaud.legrand/teaching/2015/M2R_EP_measurements.pdf\API-based" Monitoring Examples Indirect Metrics J.-M

Getting finer information

TCPdump is based on libpcap and enables to dump the traffic on anetwork card.

/proc is rather common but accessing such information requiresspecific access permissions. Such library does not work on highperformance cards such as MyriNet, InfiniBand, . . . .

J.-M. Vincent and A. Legrand Performance measurements Monitoring Examples 50 / 59

Page 59: Performance measurements of computer systems: tools and ...polaris.imag.fr/arnaud.legrand/teaching/2015/M2R_EP_measurements.pdf\API-based" Monitoring Examples Indirect Metrics J.-M

SNMP-based tools

I The Simple Network Management Protocol (SNMP) is an ap-plication layer protocol that facilitates the exchange of man-agement information between network devices. It is part ofthe Transmission Control Protocol/Internet Protocol (TCP/IP)protocol suite. SNMP enables network administrators to man-age network performance, find and solve network problems, andplan for network growth.

I Many tools build upon SNMP to gather information on routers

I SNMP can even be used to build maps of the network. How-ever, SNMP requires specific access permissions and is oftenclosed for network security reasons.

J.-M. Vincent and A. Legrand Performance measurements Monitoring Examples 51 / 59

Page 60: Performance measurements of computer systems: tools and ...polaris.imag.fr/arnaud.legrand/teaching/2015/M2R_EP_measurements.pdf\API-based" Monitoring Examples Indirect Metrics J.-M

A few HPC tools

PAPI Performance Application Programming Interface

mpiP MPI profilingvaMPIr MPI tracing, but also Tau,

Extrae, ...

PAPI is a tool developped by UTK that provides a portable accessto hardware performance counters available on most modern micro-processors (AMD Opteron, CRAY XT Series, IBM POWER, IBMCell Intel Pentium, Core2, i7, Atom,. . . , recently CUDA).

Along the “same line” and more recent: likwid (Intel and AMDprocessors on the Linux operating system)

I likwid-topology: print thread, cache and NUMA topologyI likwid-perfctr: configure and read out hardware performance coun-

ters on Intel and AMD processorsI likwid-powermeter: read out RAPL Energy information and get info

about Turbo mode stepsI likwid-pin: pin your threaded application (pthread, Intel and gcc

OpenMP to dedicated processors)...

J.-M. Vincent and A. Legrand Performance measurements Monitoring Examples 52 / 59

Page 61: Performance measurements of computer systems: tools and ...polaris.imag.fr/arnaud.legrand/teaching/2015/M2R_EP_measurements.pdf\API-based" Monitoring Examples Indirect Metrics J.-M

A few HPC tools

PAPI Performance Application Programming InterfacempiP MPI profiling

vaMPIr MPI tracing, but also Tau,Extrae, ...

I mpiP is a link-time library (it gathers MPI information throughthe MPI profiling layer)

I It only collects statistical information about MPI functions

I All the information captured by mpiP is task-local

sleeptime = 10;

MPI Init (&argc, &argv);

MPI Comm size (comm, &nprocs);

MPI Comm rank (comm, &rank);

MPI Barrier (comm);

if (rank == 0) sleep (sleeptime);

MPI Barrier (comm);

MPI Finalize ();

Task AppTime MPITime MPI%

0 10 0.000243 0.001 10 10 99.922 10 10 99.923 10 10 99.92* 40 30 74.94

J.-M. Vincent and A. Legrand Performance measurements Monitoring Examples 52 / 59

Page 62: Performance measurements of computer systems: tools and ...polaris.imag.fr/arnaud.legrand/teaching/2015/M2R_EP_measurements.pdf\API-based" Monitoring Examples Indirect Metrics J.-M

A few HPC tools

PAPI Performance Application Programming InterfacempiP MPI profiling

vaMPIr MPI tracing, but also Tau,Extrae, ...

I generate traces (i.e. not justcollect statistics) of MPI calls

I These traces can then be vi-sualized and used in differentways.

J.-M. Vincent and A. Legrand Performance measurements Monitoring Examples 52 / 59

Page 63: Performance measurements of computer systems: tools and ...polaris.imag.fr/arnaud.legrand/teaching/2015/M2R_EP_measurements.pdf\API-based" Monitoring Examples Indirect Metrics J.-M

Hard things

I An API to access monitoring information is often available butnot always. . .

I Even when these monitors are “built-in”, they are generally low-level and building a usable high-level monitoring tool requiresa lots of work on:

I SamplingI CollectionI Analysis and Presentation

I When such an API is not available you can:I either design a low-level monitor if possible,I to try to evaluate the metric you are interested in an other way.

J.-M. Vincent and A. Legrand Performance measurements Monitoring Examples 53 / 59

Page 64: Performance measurements of computer systems: tools and ...polaris.imag.fr/arnaud.legrand/teaching/2015/M2R_EP_measurements.pdf\API-based" Monitoring Examples Indirect Metrics J.-M

Outline

1 Introduction, Definitions, ClassificationsPerformance MetricFinding BottlenecksMonitors & Measurements

2 Monitoring ExamplesMeasuring Time: Practical ConsiderationsSequential Program Execution Monitoring: Profiling“API-based” Monitoring ExamplesIndirect Metrics

J.-M. Vincent and A. Legrand Performance measurements Monitoring Examples 54 / 59

Page 65: Performance measurements of computer systems: tools and ...polaris.imag.fr/arnaud.legrand/teaching/2015/M2R_EP_measurements.pdf\API-based" Monitoring Examples Indirect Metrics J.-M

CPU probing

I ATLAS (Automatically Tuned Linear Algebra Software) is anapproach for the automatic generation and optimization of nu-merical software (BLAS and a subset of the linear algebra rou-tines in the LAPACK library).

I To produce such kernels, ATLAS needs to know the number ofcache levels, their respective sizes, whether the processor hasthe ability to perform additions and multiplications at the sametime, whether it can make use of vector registers or specificinstruction sets (e.g., 3dnow, SSE1, or SSE2 extensions). . .

I There is no portable API providing such information, thereforeATLAS runs some probes to guess these values.

J.-M. Vincent and A. Legrand Performance measurements Monitoring Examples 55 / 59

Page 66: Performance measurements of computer systems: tools and ...polaris.imag.fr/arnaud.legrand/teaching/2015/M2R_EP_measurements.pdf\API-based" Monitoring Examples Indirect Metrics J.-M

Network probing

NWS The Network Weather Service is the de facto standard of theemerging Grid community to monitor the system availability. Itprovides high-level metrics to help applications and schedulers. Italso provides trends thanks to a set of statistical forecasters.

I Available CPU share for a new process ((system+user)/(total)):due to the process priorities and other scheduling tricks, thisvalue is hard to guess from the /proc values without ac-tually probing. As probes are intrusive, NWS uses /proc

values and uses a correcting factor based on regular probes.I Available bandwidth between two hosts: how much band-

width would get an application using a single standard socket? Active probes are performed.

Pathchar What about the capacity of network links between twohosts? Pathchar infers the characteristics of links along an Inter-net path by sending series of probes with varying values of TTLand of size and using statistical analysis.

J.-M. Vincent and A. Legrand Performance measurements Monitoring Examples 56 / 59

Page 67: Performance measurements of computer systems: tools and ...polaris.imag.fr/arnaud.legrand/teaching/2015/M2R_EP_measurements.pdf\API-based" Monitoring Examples Indirect Metrics J.-M

A last example

Peer-to-peer systems:

I Having good evaluations of the current number of peers is acrucial problem and an active research domain.

I “Probabilistic games” give good results.

Main Issue

All the previous approach rely on a model of the system and on pa-rameters estimation based on the expected model prediction. Whenthe model is incorrect, the estimation is likely to be incorrect as well.

J.-M. Vincent and A. Legrand Performance measurements Monitoring Examples 57 / 59

Page 68: Performance measurements of computer systems: tools and ...polaris.imag.fr/arnaud.legrand/teaching/2015/M2R_EP_measurements.pdf\API-based" Monitoring Examples Indirect Metrics J.-M

Take-away message

I Do not reinvent the wheel: do not build your own monitoringinfrastructure unless you are absolutely certain there is no otherchoice.Instead learn to use already existing tools.

I Make sure that you understand how such tools work to beaware of their limitations and impact on the measurements youwant to perform.

J.-M. Vincent and A. Legrand Performance measurements Monitoring Examples 58 / 59

Page 69: Performance measurements of computer systems: tools and ...polaris.imag.fr/arnaud.legrand/teaching/2015/M2R_EP_measurements.pdf\API-based" Monitoring Examples Indirect Metrics J.-M

References

R. K. Jain.The Art of Computer Systems Performance Analysis: Tech-niques for Experimental Design, Measurement, Simulation, andModeling.John Wiley & Sons Canada, Ltd., 1 edition, 1991.

David J. Lilja.Measuring Computer Performance: A Practitioner’s Guide -David J. Lilja - Hardcover.Cambridge University Press, 2000.

J.-M. Vincent and A. Legrand Performance measurements Monitoring Examples 59 / 59