How to solve software performance problems ?
1. Define your Objective -where you need to be?
It is surprising that many projects do not have well-defined performance objectives. When we
ask what the performance objectives are, we very often get a response like “as fast as possible.” An objective such as this is not useful as you cannot determine when you achieve it.
You should define precise, quantitative, measurable performance objectives. Performance objectives can be measured using different performance counters like response time, throughput, or constraints on resource usage.
Example – “The response time for a request should be < 2 second with up to 1,000 users.”
“CPU utilization should be less than 65% for a peak load of 1,000 requests/second.”
When defining performance objectives, one should not forget future. For example, current performance objective may be to process 1,000 request/second. However, down the line in two years, it may need to be able to process 10,000 request/second.
It is a good idea to consider future uses of your software so that you can anticipate these changes
and build in the necessary scalability.
2. Find out where you are Now?
You should measure the current counter values for all possible use cases of the application.
3. Can you achieve your objectives?
Before you start tuning your software, it is a good idea to see if you can actually achieve your objectives by tuning. If the difference between where you are now and where you need to be is small, then tuning will probably help. You may even be able to achieve your performance objectives without making changes to the code by tuning operating system parameters, network configuration, file placements, and so on. If not, you may need to tune the software. This may require software re-factoring or re-creation using the performance principles and patterns. Optimize algorithms and data structures and/or modify program code to use more efficient constructs.
Some simple calculations can help determine if performance objective can be achieved by tuning the software. If it is, then you can proceed with confidence as you tune the software.
4. Plan for Achieving Your Objectives