Motivation For Research: Software Performance
Motivation For Research: Software Performance
Software performance problems become more difficult as systems grow more complex.
Improvements in hardware do not present an automatic solution, since performance is not solely
dependent on available CPU power, but other factors, such as communication delays, play an
increasingly significant role. In addition, hardware improvements increase problem complexity
growth.
Software Performance
'Good performance' sounds like an easy concept, but it isn't so.
Performance is a compromise.
Differing Solutions
Different solutions are needed when the desired result is:
Problems in Performance
Explosive growth in CPU power hasn't solved problems in performance
• increased memory
• program growth
• program functionality harder to understand
• memory access delays
• data communication delays
• hierarchical structure
Especially
• large software
• parallel software
• layered software
• embedded software
• realtime software
• automatic analysis
• use of ready methods
• SPR designs profiling methods
Program tuning
• bit fiddling
• local improvements at the cost of clarity
Algorithmic research
• functionality
• correctness
• usability
• performance
• maintainability
Performance requirements are often focused on a limited part of the program's functionality.
• flexibility design
• evaluation of external requitements
• investigating hardware requirements
Two approaches
Regions of SPE
• execution modelling
o general models
o software models
• input modelling
o input characterization
o common/difficult input classes
• model solving
o analytical methods
o simulation
• gathering of performance data
o monitoring
o derivation of parameters
• tools
o stand-alone tools
o tool environments
• design principles
o real time systems
o embedded systems
• software engineering
o inclusion of performance into development
Performance Models
A performance model describes the program's resource usage during computing.
• total performance
o a function from input to measures
• typically structured
o contributing factors
• execution structure
o typically control flow
• resource usage
o typically time
Flow Graph
A simple model of performance; a timed flow graph
Problems
• choices, repetitions
• parallelism
• locks
Petri Nets
A Petri net consists of
• nodes
o places P
o transitions T
• directed edges P-T or T-P
System state
Usage
• describing parallelism
• describing locking
Example
Several kinds of Petri nets
• amount of edges
• amount of tokens
• timed events
• stochastic events
• static values
Queuing networks
Queuing networks consist of
• nodes
o queuing servers
o queueless servers
• directed graphs
System state
• jobs
• queuing discipline (FCFS, LCFS-PR, RR, PS, SJF, SRT, etc.)
Usage
Example
Below a simple system:
Performance
• service times
• branching probabilities
• static values
• several job types
• extensions neccessary
• new types of nodes
• more difficult to solve
Other Models
There are many methods to model performance. Their basis is usually
Network-based models are usually represented in a graphical form; several other models have a
source-code-like representation.
Software Modelling
Software complexity presents a problem
• abstractions
• modularity
• parallelism
How to reveal the significant parts and clear away the rest?
Example: Execution Networks
One way to deal with the problem are heterogenous and hierarchical models
Input Models
Besides execution, input must be modelled
• declarative
• procedural
• real
• syntethic
• artificial
• possible inputs
• probability of each
• continuous
• one-shot inputs
Example: G(n, p)
G(n, p) is a commonly used input model in the analysis of network algorithms
• statistical
• efficiently executable
• one-shot
Properties
Established benchmarks
• Whetstone
• Dhrystone
• Linpack
• Perfect Club
• SPEC
• TCP (A,B,C)
Example: Dhrystone
Dhrystone is a typical system program execution benchmark
Model Interpretation
The measurement of performance as a function of input parameters is what should
be solved from a performance model
• performance goal
• differnet views on the same model
Analytical Solution
Analytical solution of net models is often based on statistical analysis.
• static analyysi
• model states
• state transformations
• dynamical analysis
• simulation program
• can be solved well, but requires computation
Simulation can be
• continuous (steady-state)
• repetition of experiments with parameter variations
• statistical processing
• input generation
• system warm-up
• verification
• validation
Simulation Example I
Job-based simulation
job(char *name) {
create(name);
while (completions < warm_up + measure) {
reserve(cpu);
hold(10.0);
release(cpu);
if (prob() < 0.5) {
reserve(disk1);
hold(20.0);
release(disk1);
} else {
reserve(disk2);
hold(30.0);
release(disk2);
}
completion_count++;
if (completions == warm_up)
reset();
}
if (completions == warm_up + measure)
set(done);
}
Simulation Example II
Server-based
cpu() {
int job;
int ndisk;
create("CPU");
while(job_count) {
job = wait_any(enter_cpu);
use(fcpu, 10.0);
set(cpu_free);
ndisk = prob() < 0.5 ? 0 : 1;
if (num_busy(fdisk[ndisk]))
queue(disk_free[ndisk]);
if (ndisk)
set(enter_disk1[job]);
else
set(enter_disk0[job]);
}
}
• time T
• throughput X
• completion count C
• service demand D
• job time W
• job count L
• utilization U
• response time R
• arrival rate lambda
• service rate mu
Software Performance Engineering
Covers the whole lifespan of the software
• requirement analysis
o realism of the goals?
o equipment suitability?
o usage of the software?
• designing the overall structure
o alternatives fit for implementation?
o unfeasible alternatives?
• detailed software design
o performance prediction
o comparison of implementation alternatives
• implementation, testing
o monitoring the development of the actual performance
o solving unexpected problems
• maintenance
o the impact of the development of the external factors?
o impact of software updates?
• overview
• modeling
• experimentation
• interpretation
Overview
• Defining the system under study
o consists of what, does what
o prerequisite for systematic inspection
o often includes the hardware
• Performance goals
o important!
bad: find out if the new system is a good one
o
good: response time upper limit of C for input B, under the
o
circumstances A.
o goal cannot be biased
• design of analysis
o how to do analysis
o neccessary tools
o reports produced
Modeling
Modeling aims to divide execution to a structure explaining performance.
• I/O
program input
o
program output
o
difficult inputs
o
typical inputs
o
• measures, parameters, factors
o how to measure performance
o accurate methods!
o factors involved
o which factors to model
• models
o input model
o execution structure
o execution resources
o from hardware viewpoint
Measurements
Practical measurements are involved in many analyses
• existing software
o real software in real environment
o embedded products
o non-interference of measurements
• software being designed/developed
o few packages are built from scratch
o performance prototypes
o connection to the real software
o change management
• measurement planning
o beforehand!
o statistical confidence
o equipment usability, measurement organization
o measurement errors
• monitors
o hardware, software, hybrid
o tracing
o sampling
Interpretation
model solving
• validation
o does the model correspond to the reality?
• tools
• simulation
o verification
• error bounds
results
• DB server
• interface: queries through the network
• hardware
o CPU
o three disk drives
• an old method of optimizing queries
o could be replaced by a new one
o halves the needed CPU time
o 50% less traffic on main disk
Example: Overview
Performance goal
Analysis design
Choice of measures
The model enabled the solving of the DB table usage per service type
UC UO UI QC QO QI OT
Table access count
Tbl_Cust 2 1 1
Tbl_Ord 2 1
Tbl_Ord_Row 12 30 6 15
Tbl_Inv 2 1
System data access cnt 3
• typical load
CPU 85%
DISK A 80%
DISK B 10%
DISK C 40%
Service requests
UC UO UI QC QO QI OT
CPU 0.025 0.013 0.006 0.009 0.008 0.006 0.058
diskA 0.018 0.011 0.013 0.014 0.013 0.012 0.000
diskB 0.000 0.000 0.021 0.000 0.000 0.019 0.023
diskC 0.033 0.033 0.033 0.033 0.033 0.033 0.033
Branching probabilities
UC UO UI QC QO QI OT
diskA 0.323 0.771 0.847 0.208 0.699 0.782 0.0
diskB 0.323 0.771 0.903 0.208 0.699 0.834 0.484
diskC 0.839 0.945 0.972 0.791 0.913 0.947 0.839
• warmup 5000sek
• batch 500sek
Example: Comparison
Change of parameters in accordance with the improvements from the new
optimization method
• comparison
• paired-T