Key takeaways
- Different questions need different tests: load (expected traffic), stress (beyond it), spike (sudden jumps), soak (hours or days) and scalability.
- Measure percentiles (p95, p99), throughput, error rate and resource use. Averages hide the slow experiences users complain about.
- A performance test is only as good as its workload model and environment. Unrealistic traffic or a tiny test server give confident, wrong answers.
Where this picks up
You know that performance is a non-functional quality: not what the system does, but how well under real conditions. This article covers how to actually test it.
The main types
| Type | Question it answers | Example |
|---|---|---|
| Load test | Does it meet targets at expected traffic? | 2,000 concurrent users on a normal Monday |
| Stress test | Where does it break, and how? | Increase users until errors rise; does it fail gracefully? |
| Spike test | Can it handle a sudden jump? | Traffic ×10 in one minute when a sale starts |
| Soak (endurance) test | Does it stay healthy over time? | Normal load for 12 hours; watch for memory leaks |
| Scalability test | Does adding resources add capacity? | Double the servers; does throughput nearly double? |
The numbers that matter
Response time, as percentiles
The p95 response time is the time within which 95% of requests finish. The slowest 5% take longer.
Why not the average? If 95 requests take 200 ms and 5 take 8 seconds, the average is about 0.6 seconds, which looks fine. But one in twenty users waits 8 seconds. On a page with many requests, most users will hit at least one slow one.
Set targets as percentiles: "p95 under 800 ms, p99 under 2 s, at 2,000 concurrent users."
The rest
- Throughput: requests or transactions per second the system handles.
- Error rate: errors and timeouts under load. A system that's "fast" because it fails quickly isn't fast.
- Resource use: CPU, memory, database connections, queue lengths. They show why it slows down.
In the browser
For web pages, Google's Core Web Vitals measure what users feel:
| Metric | Measures | "Good" threshold |
|---|---|---|
| LCP (Largest Contentful Paint) | How fast the main content appears | ≤ 2.5 s |
| INP (Interaction to Next Paint) | How fast the page responds to clicks and typing | ≤ 200 ms |
| CLS (Cumulative Layout Shift) | How much the layout jumps while loading | ≤ 0.1 |
Designing a realistic test
- Define the goals with the business: expected users, peak times, acceptable response times. Get numbers, not "fast".
- Build a workload model from real data: which journeys, in what proportions. For example, 70% browse, 20% search, 8% add to cart, 2% pay.
- Add think time. Real users pause between actions. Without pauses, 100 virtual users can generate the load of thousands.
- Use realistic data. Searching the same product a million times only tests the cache.
- Use a production-like environment. A test server with a quarter of the resources gives results you can't scale up reliably.
- Monitor everything during the test: application, database, servers, external services.
- Run a baseline, then change one thing at a time.
Common tools include JMeter, Gatling, k6 and Locust for load, and Lighthouse and browser developer tools for front-end performance.
Plan for more than you expect
When Pokémon GO launched in July 2016, its developer Niantic and Google Cloud had planned capacity for a target level of traffic, with a worst case of about five times that target.
According to Google Cloud's account of the launch, player traffic surged to 50 times the initial target, ten times the worst-case estimate. Players faced login failures and server errors, and the teams scaled the infrastructure up while the game was live.
Lesson: load tests at "expected" traffic aren't enough for launches with unpredictable demand. Stress and spike tests show where the system breaks and how, and whether it can scale quickly when reality beats the forecast.
Reading the results
- Look at the curve, not one number. How do response times and errors change as load rises? A sharp bend shows the limit.
- Find the bottleneck. Is CPU at 100%? Database connections used up? A slow external call?
- Compare with the baseline after every change.
- Report in business terms: "The site handles 3,000 concurrent shoppers within target; at 4,500, checkout errors reach 5%. Black Friday forecast is 4,000."
Do
Run a small, automated performance check in the pipeline (a few key endpoints against a time budget), plus full load tests before major releases.
Don't
Run one load test a week before launch, discover a bottleneck in the architecture and have no time to fix it.
Check yourself
A load test reports an average response time of 400 ms, which meets the target. The p99 is 9 seconds. Is the system performing well?
Show answer
Not necessarily. 1 in 100 requests takes 9 seconds. On pages that make many requests, or for heavy users, that's a frequent, frustrating experience. Investigate what the slow requests have in common, such as particular data, endpoints or times, and set targets on percentiles, not averages.
