Skip to content
Figure 1Response time and error rate as concurrent users rise
Response time and error rate as concurrent users riseknee: capacity limitconcurrent virtual usersp95 response timeerror rate
As virtual users rise, p95 response time climbs slowly, then sharply at the knee, and the error rate follows.

Performance testing: types, workload models and p95 results

Most performance tests fail before they run, because the workload does not resemble production and the pass criterion is an average. Getting the model and the percentiles right matters more than the tool, and both can be settled with a week of production logs and a table.

Quick answer

Performance testing measures how a system behaves under a defined workload: response time, throughput, error rate and resource use. Load testing checks expected traffic, stress testing finds the breaking point, soak testing runs for hours to expose leaks, spike testing hits sudden surges. Build the workload from production data, judge results by p95 and p99, and test on production-sized capacity.

Key figures

Test types
6: load, stress, soak, spike, scalability, volume
Percentiles that matter
p50, p95, p99
Typical soak duration
8 to 72 hours
Worked model peak
1,200 requests per minute, 5 transaction types
Example target
p95 under 800 ms, error rate under 0.1 percent
Environment parity
same instance class, same data volume, same network path

Six types of performance test

Each type answers one question, and mixing them in one run answers none. A load test asks whether the system meets its targets at expected traffic. A stress test asks where it breaks and how it fails. A soak test asks whether it degrades over hours. A spike test asks whether it survives a sudden surge and recovers. A scalability test asks how much you gain by adding capacity. A volume test asks what happens when the data, not the traffic, is large. The table gives each its goal, its traffic shape, its duration and the signal that means it passed.

The six performance test types, one question each.
TypeGoalTraffic shapeDurationPass signal
LoadMeet targets at expected peakRamp to peak, hold steady30 to 60 minutesp95 and error rate within target for the whole hold
StressFind the breaking point and failure modeRamp beyond peak until failureUntil failure plus recoveryKnee is above 1.5x expected peak; failure is graceful and recovers
Soak (endurance)Expose leaks, growth, exhaustionSteady at 70 to 80 percent of peak8 to 72 hoursNo upward drift in response time or memory after warm-up
SpikeSurvive a sudden surgeJump from baseline to 3x to 10x in seconds10 to 20 minutesErrors stay bounded; recovery to baseline within an agreed time
ScalabilityMeasure gain per unit of capacitySame load at 1x, 2x, 4x capacity3 runs of 30 minutesThroughput scales near linearly; the bottleneck is identified
VolumeBehavior with large data setsNormal traffic against 10x data30 to 60 minutesQuery times stay within target as tables grow

Workload modelling from production data

A workload model states who does what, how often, at what peak. It comes from production, never from opinion. Pull one representative week of access logs, count requests by endpoint or transaction, find the peak hour, and convert to a transaction mix. If the product is new, use the business plan's user numbers and a comparable product's behavior, and label the model as an assumption to be replaced after launch. The worked example below is a retail checkout service whose logs showed a peak of 1,200 requests per minute on a Thursday evening.

A worked transaction mix for a checkout service at 1,200 requests per minute peak.
TransactionShare of peak trafficRequests per minute at peakThink time between stepsNotes
Browse catalog55 percent6605 to 15 secondsCacheable, read-only
Search20 percent2403 to 10 secondsDatabase heavy, long-tail queries
Add to basket12 percent1442 to 8 secondsWrites to session store
Checkout8 percent9620 to 60 secondsCalls payment provider; the business-critical path
Account and order history5 percent605 to 20 secondsAuthenticated, low volume, slow queries

Three details separate a usable model from a toy. Think time must be realistic, because 200 virtual users with zero think time generate the load of 2,000 real users and break the system in a way real users never would. Data must vary: a search test that always searches the same word measures the cache, not the database. And the model needs a growth factor: test at 1.5x to 2x the observed peak so that the result still holds next quarter.

The results that matter, and why averages lie

Report five numbers: p50, p95 and p99 response time, throughput in requests per second, and error rate. Add resource saturation (CPU, memory, connection pool, disk queue) for the tier that limits capacity. Then stop. The mean response time is not on the list because it hides the users you should care about. A service where 95 requests take 200 ms and 5 take 12 seconds has a mean of 790 ms, which sounds acceptable, and a p95 of 200 ms with a p99 of 12 seconds, which tells you 1 in 20 customers waits long enough to leave. Percentiles describe the experience of real users; the mean describes nobody's.

  • p50 shows the typical experience and is the number to watch for regressions between builds.
  • p95 is the usual contractual target; it covers 19 of every 20 requests.
  • p99 exposes tail latency from garbage collection pauses, lock contention and cold caches; a p99 more than 5x the p50 is a design smell.
  • Throughput that stops rising while load rises means you have found the knee.
  • Error rate above 0.1 percent under load usually means timeouts, and timeouts are the customer's experience of slowness.

Environment parity

A performance result is only as good as the environment's resemblance to production. Match the instance class and count, the database size (a 10,000-row test table says nothing about a 40-million-row production table), the network path including any gateway or firewall, and the third-party dependencies, which should be stubbed with realistic latency rather than left live. Where full parity is unaffordable, run at half scale and half load, and state plainly that the result assumes linear scaling, which the scalability test then verifies. Never extrapolate from a shared test environment where another team's job may have been running.

How to set targets

Targets come from three places: user research on tolerable wait (roughly 1 second before attention drifts, 10 seconds before abandonment), business commitments in contracts, and the current production baseline. A reasonable first set for a customer-facing web service is p95 under 800 ms and p99 under 2 seconds for reads, p95 under 1.5 seconds for writes such as checkout, error rate under 0.1 percent, and no degradation over an 8-hour soak. Tie each target to a transaction in the model rather than to the system as a whole, because a slow account history page is tolerable and a slow checkout is not. When a target is missed, rank the fix with the same risk-based logic as any functional defect.

Rule of the knee

Find the knee in a stress test before you set load test targets. If the knee sits at 1,400 requests per minute and peak is 1,200, you have 17 percent headroom, which is a capacity finding worth more than any pass or fail.

Reporting

A performance report is read by people who will not open the raw data, so lead with the verdict and the headroom. One page: the workload model used, the environment and how it differs from production, a table of each transaction against its target with p50, p95, p99 and error rate, the response-time-against-load chart with the knee marked, and the bottleneck identified with evidence. Keep every run's results so that the next release can be compared, and treat unexplained run-to-run variance above 10 percent the way you would treat flaky tests: as a problem with the harness until proven otherwise. Definitions of the metrics are in the glossary.

Common questions

What is the difference between load testing and stress testing?

Load testing checks the system at expected traffic and asks whether targets are met. Stress testing pushes past expected traffic to find where and how it breaks. Load is a pass or fail; stress is a measurement.

How many virtual users do I need?

Derive it from the model: requests per minute divided by requests per user per minute, which depends on think time. 1,200 requests per minute with 10 seconds average think time needs about 200 concurrent users.

Why does my test pass but production is slow?

Usually one of four reasons: unrealistic think time, repeated data hitting caches, a smaller database than production, or a shared environment. Check them in that order.

How long should a soak test run?

Long enough to cover at least two cycles of anything periodic: log rotation, cache expiry, scheduled jobs, garbage collection at full heap. Eight hours is a minimum; 24 to 72 hours for systems that stay up for weeks.

Should performance tests run in the pipeline?

A short load test (10 to 15 minutes at 50 percent of peak) can run nightly and catch regressions in p50. Full load, stress and soak tests belong on a schedule and before releases.

What is the difference between response time and latency?

Latency is the delay before the first byte; response time is the full time to complete the request. For a user, response time is what matters. Tools report both; make sure the target names the one you mean.

Sources

  1. ISO/IEC 25010:2023, SQuaRE product quality model
  2. ISO/IEC/IEEE 29119-1:2022, Software testing, Part 1: General concepts
  3. DORA research program, software delivery performance metrics

Further reading named in the text

  • Ian Molyneaux, The Art of Application Performance Testing, 2nd edition (O'Reilly Media, 2014)
  • Brendan Gregg, Systems Performance: Enterprise and the Cloud, 2nd edition (Addison-Wesley, 2020)
  • Daniel A. Menasce, Virgilio A. F. Almeida, Capacity Planning for Web Services (Prentice Hall, 2001)

This guide is part of the software testing techniques hub. It is best read alongside security testing and software testing metrics, which cover the neighbouring questions.