Published October 10, 2022
by Doug Klugh
Building High-Capacity Software
Approach capacity testing by first analyzing requirements and measuring performance — do not simply guess or rely on intuition. Performance bottlenecks are often not where you think they are — especially in early development. Apply YAGNI to avoid over-engineering and premature optimization. Take time to measure capacity by evaluating load, longevity, scalability, and throughput. The goal of capacity testing is to determine if a performance issue exists. Focusing on optimization too early will often impede the delivery of a high-performing system.
« Premature optimization is the root of all evil. »
- Structured Programming With Go To Statements, December 1974 - Donald Knuth
The following types of tests are often used to evaluate specific characteristics related to system capacity:
Measures the load on the application to determine the impact to capacity. These tests should reproduce loads that are expected to occur with various production scenarios.
Measures performance over a protracted period of operation to obverse adverse effects caused by memory leaks, network contention, or other stability issues.
Measures the response time of individual requests as the number of concurrent users, services, and/or threads increase and decrease at different rates over various periods of time.
Measures the number of messages, requests, or transactions the system can handle over a given period of time. These tests usually record the average number of transactions processed each second.
assistant Development Tip
Refactor, Then Optimize
Refactor code before optimizing to make your software more adaptable to performance tuning. Building software that is well-factored without attention to performance will produce finer granularity for performance analysis — providing effective identification of performance hot spots. Even when refactoring impacts performance, you can... Read More