An app that feels instant with one user can crawl, or fall over, when a thousand arrive at once. Performance testing puts your app under realistic and unrealistic pressure on purpose, so you find out how it behaves before your users do.
What performance testing measures
A functional test asks 'does it work?'. A performance test asks 'how well does it work, and for how many people at once?'. You simulate many users sending requests, and you watch a handful of numbers.
- Response time: how long a request takes from the user's side, from sending it to getting the full answer.
- Throughput: how many requests the system finishes per second.
- Error rate: the share of requests that fail or time out.
- Resource use: CPU, memory, disk and network on each server, plus things like open database connections.
Why averages hide the problem
Response time is usually reported as percentiles, not an average. The p95 is the time that 95% of requests finish within; the p99 is the time 99% finish within. If most requests take 100 ms but one in twenty takes 3 seconds, the average still looks healthy while one user in twenty is staring at a spinner. A target such as 'p95 under 500 ms' describes what users feel far better than 'average under 200 ms'.
The numbers also only mean something together. Response time that stays flat while throughput climbs is good news. Response time that climbs while throughput stops growing means something is saturated: the system has hit a limit and requests are queueing for it.
Load tests and stress tests
'Performance testing' is the umbrella. Underneath it are a few test types, which differ mainly in how much traffic you send and what question you are asking.
Load testing
A load test sends the traffic you expect: a normal busy day, or the peak you plan for. You ramp up to that level, hold it for a few minutes, and check the results against your targets. It answers one question: at 100 users, or whatever your real peak is, do we stay fast and error-free?
Wondering how this was made? How we make these