Best practices

What Is Load Testing? Types, Steps, and Examples

Key takeaways

  • Set pass and fail targets from your real traffic before you write any scripts.

    Find your peak concurrent users in analytics, then pick limits such as a 95th-percentile response time under one second and errors under 1%, so every run ends with a clear verdict.

  • Ramp users up in steps, and hold each level until response times settle.

    A sudden jump to full load only tells you that something broke, while steps show the level where response times start to climb.

  • Run load tests against a production-like environment that nothing else is using.

    Other traffic muddies the results, and a smaller environment runs out of resources at levels your production servers would handle.

  • Watch server metrics alongside response times while the test runs.

    CPU, memory, database connections, and queue depth show which part of the system gives out first, which is the part to fix.

  • Use protocol-level tests for backend throughput, and browser-level tests to see what users wait for.

    One machine can simulate thousands of request-only users, while real browsers also measure the JavaScript, rendering, and every call the page makes.

Load testing checks how an app performs when many people use it at the same time. A load test sends a set number of concurrent users through the app, such as 500 people signing in and searching at once, and measures response times, errors, and server resources as that number climbs.

It's a different thing from testing how fast a page loads. Page load time is about one visitor's browser, while a load test is about what happens to your servers, databases, and APIs when the traffic arrives together. QA Wolf's guide to web performance metrics covers page speed.

What is load testing?

Load testing is a kind of performance testing that puts an app under the number of users it expects and checks that it stays fast and error-free. The load is concurrent user sessions, meaning people (or scripts acting as people) signing in, searching, and saving at the same time.

Teams run load tests before a launch, a marketing push, or a seasonal peak. They also run them after changes to how the app handles traffic, such as a new database query, a new caching layer, or a move to new infrastructure.

Performance testing is the wider family. It includes load, stress, soak, and spike testing, and benchmarking, plus front-end page performance testing, which times events in one visitor's browser.

What does a load test measure?

A load test records how the app responds at each level of traffic, and how hard the servers work to keep up:

  • Response time: How long requests or user actions take, usually read as percentiles. The 95th percentile (p95) is the time that 95% of requests beat, so it shows what the slowest users get, which an average hides.
  • Error rate: The share of requests that fail or time out.
  • Throughput: The requests or transactions the app completes each second.
  • Concurrent users: How many sessions are active at once at each stage of the test.
  • Resource use: CPU, memory, database connections, and queue depth on each server, which point to the bottleneck when response times climb.

Why is load testing important?

Functional tests usually run one user at a time, so they don't find traffic problems. A sign-up flow can pass every end-to-end test with one user and still time out with 300 users at once, because the database runs out of connections or a third-party API starts rate limiting the requests.

A load test finds the number of concurrent users where response times start to miss your target, and the part of the system that gives out first, before real traffic does. That tells the team what to fix, and how much headroom it has before the next peak.

What are the types of load testing?

The same tools run several kinds of test, each with its own load profile. Most guides list four: load, stress, soak, and spike testing. Capacity testing is often counted as a fifth.

TypeWhat it answersLoad profile
Load testingDoes the app meet its targets at the traffic you expect?Ramp up to the expected peak, then hold it
Stress testingWhere does the app break, how does it fail, and does it recover?Keep adding users past the expected peak
Soak testingDoes performance hold up over a long run?Normal traffic, held for hours
Spike testingCan the app absorb a sudden surge and recover after it?A jump from normal traffic to many times normal, then back
Capacity testingHow many users can the app serve within its targets?Step the load up until a target is missed

Load testing

A load test runs the traffic you expect, ramped up to your expected peak and held there. It passes when response times and error rates stay within the targets the team set. Run it before every release that could change performance, and before every busy season.

Stress testing

A stress test keeps adding users past the expected peak until something fails. It shows the breaking point and what breaks first. It also shows whether the app fails gracefully, with slower pages, a queue, or a clear error message, or badly, with lost data and crashes, and whether it recovers once the load drops.

Soak testing

A soak test, also called an endurance test, holds normal traffic for hours. It catches problems that build up over time, such as memory leaks, database connections that never get released, logs that fill a disk, and caches that grow without limit.

Spike testing

A spike test jumps from normal traffic to a sudden surge, then drops back. It checks how autoscaling, caches, and rate limits react when a launch email goes out or a sale opens, and whether the app returns to normal once the surge passes.

Capacity testing

A capacity test steps the load up, level by level, to find the most users the app can serve while still meeting its targets. Teams use that number to plan infrastructure and to know how much headroom they have before a peak.

Load testing vs. stress testing: what's the difference?

A load test checks the app at the traffic you expect, and a stress test pushes past it to find where the app breaks. A load test ends in a pass or a fail against your targets. A stress test ends in a breaking point, plus how the app failed and how it recovered.

Run the load test before every release that could change performance. Run a stress test before a big launch, or after a change to the architecture, since that's when your old breaking point stops being true.

How do you do load testing?

A load test takes seven steps, from setting targets to re-running the test after a fix:

  1. Set targets from real traffic: Find your peak concurrent users in analytics and production monitoring, then set the targets a run must meet, such as a p95 response time under 800 milliseconds and an error rate under 1%.
  2. Pick the user flows to simulate: Choose the flows that carry the most traffic or the most revenue, such as signing in, searching, and checking out, and mix them in the proportions real users do.
  3. Prepare a production-like environment: Match production's instance sizes, database size, and configuration, with test data for every simulated user. Keep other traffic off it, and stub the third-party services you call, or warn their owners.
  4. Write the scripts: Script each flow in a load testing tool, with pauses between steps so each simulated user moves at a person's pace. Give each user its own account and data so they don't collide.
  5. Ramp up in steps: Start below your expected traffic and add users in steps, holding each level until response times settle.
  6. Watch the system while it runs: Track CPU, memory, database connections, and error logs on every tier, alongside the response times the tool records.
  7. Fix the bottleneck and re-run: Find the level where a target was first missed and the resource that ran out there, fix it, and run the same test again to confirm the fix.

A load test example

Say a web app expects about 300 users at once at its busiest. A load profile for it could look like this:

StageConcurrent usersHoldPasses if
Warm-up505 minutesp95 under 800 ms and errors under 1%
Expected traffic15010 minutesp95 under 800 ms and errors under 1%
Peak30015 minutesp95 under 800 ms and errors under 1%
Headroom45010 minutesRecorded for planning, not pass or fail

If the p95 response time passes at 150 users and climbs past 800 milliseconds at 300, the bottleneck sits between those two levels, and the server metrics from the peak stage show which resource ran out.

Which tools are used for load testing?

Load testing tools come in two kinds, depending on what each simulated user is.

Protocol-level tools send requests (HTTP, WebSocket, gRPC, etc.) straight to the app, with no browser. One machine can simulate thousands of users, so they're the cheapest way to put a backend or an API under high volume. Open-source examples include k6 (tests in JavaScript), Apache JMeter (a Java application with a GUI for building test plans), Gatling (Java or JavaScript), and Locust (Python).

Browser-level tools run each simulated user in a real browser, usually driven by Playwright. They measure what users wait for, including the JavaScript, the rendering, and every call the page makes, and they can reuse end-to-end test code. A browser takes far more CPU and memory than a request, so a browser-level test needs many more machines for the same number of users. Artillery's Playwright engine and k6's browser module both work this way.

The two kinds work together. A protocol-level test finds the backend's limits at high volume, and a browser-level test shows what that load does to the flows your users go through.

How does QA Wolf do load testing?

QA Wolf runs Playwright load testing with real browsers, as part of its enterprise plan. It runs many runners at once against your environment, steps up the number of concurrent users, and asserts response times at each level.

For page speed rather than traffic, a QA Wolf flow can run a Lighthouse audit and assert on the performance score and each Core Web Vital.

Load testing is a custom enterprise plan, priced and set up by QA Wolf's sales team, so talk to sales to plan your first load test.

Frequently asked questions

  • What are the four types of load testing?

    The four usually listed are load testing (the traffic you expect), stress testing (past the breaking point), soak testing (normal traffic held for hours), and spike testing (a sudden surge). Capacity testing, which finds the most users an app can serve within its targets, is sometimes counted as a fifth.

  • Is load testing the same as performance testing?

    No. Performance testing is the wider category, covering any test of an app's speed, responsiveness, and stability. Load testing is one kind of it, about how the app performs with many concurrent users, beside stress, soak, and spike testing and front-end page performance testing.

  • Can you do load testing manually?

    Only at a very small scale, by having a group of people use the app at the same time while someone watches the servers. A group of people can't reach realistic traffic or repeat a test exactly, so load tests are scripted in a load testing tool, which simulates hundreds or thousands of users and runs the same profile again after every fix.

  • What is load testing for websites?

    For a website, a load test simulates many visitors browsing and using the site at once and measures server response times, errors, and resource use as the traffic grows. It's separate from page speed testing, such as a Lighthouse audit or Core Web Vitals, which measures how fast pages load for one visitor.

More from the blog

All posts