Performance Testing Examples: Load, Stress, Spike and Soak Tests With Sample Scenarios

Isometric columns rising like a load ramp to one tall violet spike, then a flat plateau, for performance tests

TL;DR: Six performance testing examples cover most release risk. Load: checkout at expected peak. Stress: checkout pushed past peak to find where it breaks. Spike: a login surge after an email send. Soak: search held at normal traffic for eight hours. Scalability: users and instances added in steps. Volume: a report export against a production sized database. Write each test's goal, traffic shape and pass criteria before the first run.

Most guides define the six test types and stop there. This one gives each type a scenario with its goal, traffic shape, example pass criteria and the failure it usually points to. It also includes a short k6 load script for CI. Any number labeled as an example target is a starting point, not a standard.

Quick answers

What is a good first performance test to run if our team has never done one? Start with one load test on a revenue or login journey, run at the peak traffic your production analytics show. Ramp up over a few minutes, hold the target number of virtual users, then ramp down. Write the pass criteria first: a p95 latency target, an error rate ceiling, and CPU or memory limits, tuned for your product.

How do stress, spike and soak tests differ in what a failure tells us? Stress failures usually point to the first hard limit, such as a connection pool, a thread pool or database locks. Spike failures usually point to autoscaling that reacts too slowly, cold caches or rate limiters. Soak failures show up as slow degradation over hours and usually point to memory leaks, unclosed connections or growing disk use.

Should performance tests run on every pull request or only before releases? Run a short, low volume load test in CI whenever a critical API changes, so regressions show up before merge. Schedule full stress, spike, soak and volume runs nightly, or as a pre release gate in an environment approved for that load. Compare every run with a saved baseline and fail the gate when a threshold is breached.

What are performance testing examples?

Performance testing examples are concrete scenarios that show how an application or API behaves under a defined workload. Each one names a goal, a traffic shape, pass criteria and the failure it usually exposes. Every threshold below is an example target to replace with numbers from your own baseline.

  • Load (checkout at expected peak): Confirm checkout meets its targets at the busiest hour on record. Ramp to peak virtual users (VUs, simulated concurrent users) over 5 minutes, hold for 15, then ramp down. Example targets: p95 under 500 ms, failed requests under 1%, app CPU under 70%. Failures usually point to slow queries or an undersized connection pool.
  • Stress (checkout past peak): Find the breaking point and see how the system fails. Add load in steps above peak every 5 minutes until errors climb. It passes if the system rejects excess traffic cleanly with 429 or 503 responses instead of timing out, and recovers within an agreed time. Failures point to thread exhaustion or lock contention on inventory rows.
  • Spike (login surge after an email send): Confirm authentication survives a sudden jump. Hold a baseline for 2 minutes, jump to an example 10x within 30 seconds, then hold for 5 minutes. It passes if p95 login latency is back on target within a minute, with no lockouts. Failures point to autoscaling lag, cold caches or session store saturation.
  • Soak (search for eight hours): Catch degradation that builds over time, using flat traffic at typical load. It passes if p95 at hour eight is within an example 10% of hour one and memory stays flat after warmup. Failures point to leaks in caches or sessions, or unclosed connections.
  • Scalability (users and nodes together): Step through 2 nodes at N users, 4 nodes at 2N users and 8 nodes at 4N users. It passes if throughput rises roughly in line with node count while p95 holds. Failures point to a shared bottleneck, such as a single database primary or a global lock.
  • Volume (report export on large data): Run 5 to 10 VUs against a database seeded with production sized data. It passes if the export finishes within its timeout with no memory spikes. Failures point to missing indexes, full table scans or unbounded result sets loaded into memory.

What can a written scenario do for a release?

A written scenario turns "the site should be fast" into a test anyone on the team can rerun. It fixes one traffic shape, one set of thresholds and one expected failure signal. The same file then works as a template, a fair workload for comparing tools, and a release gate.

  • Template: Every scenario fills the same fields: goal, environment, VU stages, think time, thresholds and stop conditions.
  • Tool comparison: Script one scenario in each candidate tool and compare authoring effort and CI fit. Our performance testing tools guide covers the tools themselves.
  • Gate: A threshold in the script fails the CI job, so nobody judges a chart by eye.
Black and white photo of a laptop, smartphone, and open lined notebook with a pen on a dark desk

Why do these scenarios matter in 2026?

Performance scenarios matter because users abandon slow experiences, and release gates need sourced numbers rather than opinions. Google's published browser thresholds give a defensible starting point, while API targets must come from each service's baseline.

Google reported that 53% of mobile site visits are abandoned when a page takes longer than three seconds to load (Think with Google, 2016). Core Web Vitals rate a page "good" when Largest Contentful Paint is 2.5 seconds or less and Interaction to Next Paint is 200 ms or less, both at the 75th percentile (Google, web.dev, 2024).

For APIs, judge p95, p99, throughput and error rate together, because a fast p95 can hide climbing errors. For multi tenant products, add a "noisy neighbor" test: drive one large tenant to peak while a small tenant runs normal traffic, and check that the small tenant's p95 holds. A breach usually points to shared pools, missing per tenant rate limits or an unindexed tenant_id filter.

How does a load test run, step by step?

A load test run combines one scripted journey, staged virtual users, thresholds written before the run, and an approved target environment. The script below models the checkout scenario in k6. When a threshold is breached, k6 exits with a non zero code and the CI job fails.

// checkout-load.js

import http from 'k6/http';

import { check, sleep } from 'k6';

export const options = {

stages: [

{ duration: '5m', target: 200 }, // ramp to example peak

{ duration: '15m', target: 200 }, // hold

{ duration: '2m', target: 0 }, // ramp down

],

thresholds: {

http_req_duration: ['p(95)<500'], // example target, set per product

http_req_failed: ['rate<0.01'], // example target

http_reqs: ['count>1000'], // proves traffic reached the service

},

};

export default function () {

const res = http.post(

`${__ENV.BASE_URL}/api/checkout`,

JSON.stringify({ cartId: `cart-${__VU}` }),

{ headers: { 'Content-Type': 'application/json' } }

);

check(res, { 'status is 200': (r) => r.status === 200 });

sleep(1);

}

  1. Isolate data. cart-${__VU} gives each virtual user its own cart, so concurrent users never overwrite each other's state.
  2. Run against staging. k6 run -e BASE_URL=https://staging.example.com checkout-load.js. Per the k6 thresholds docs, a failed threshold makes the run exit with a non zero code.
  3. Gate the pipeline. Add the command as a GitHub Actions step, or as sh 'k6 run -e BASE_URL=https://staging.example.com checkout-load.js' in a Jenkins stage after the staging deploy.
  4. Check volume. The http_reqs threshold catches a run that never reached the service. Empty charts do not mean zero latency.

Which approach fits your team best?

Choose based on who owns performance work and which release event worries you most. SDETs who code get the most control from scripts in CI, teams with API regression suites can reuse them as workloads, and teams facing seasonal peaks need scheduled rehearsals.

ApproachBest forPricing modelTradeoff
Open source scripting toolsSDETs who codeFree tool, you pay for runnersYou maintain every script
Managed cloud load serviceHigh, distributed trafficPay per useCost and data controls per run
ContextQA API load testingReusing API test casesDemo and quoteAPI journeys only; Export k6 shows the script
Event rehearsalSeasonal or payday peaksProduction like environmentNeeds realistic data and capacity

How does ContextQA handle load scenarios?

ContextQA builds API load tests from the API test cases you already maintain. In Load Testing, you order the cases each virtual user runs, pick the environment, add stages with Duration (s) and Target VUs, and set pass/fail thresholds. The platform runs the workload on k6 and compares a baseline run against a candidate.

The API load testing docs cover three practical points:

  • Reuse journeys. Virtual users run the same API cases as your regression suite, so there is no second set of scripts.
  • Inspect the workload. Preview k6 script and Export k6 show the generated code, which you can commit to your repo.
  • Read verdicts carefully. A cancelled run, or a metric with no data, does not pass a threshold.

Functional suites run from Jenkins and GitHub Actions, and the MCP server lets your team trigger them from Claude Code or Cursor.

To turn the API journeys you already have into staged load tests with thresholds and baseline comparisons, book a ContextQA demo, or see code export first.
Tablet on a wooden desk showing an analytics dashboard with a traffic pie chart and visitor line graph beside a coffee cup

What should you do right now? A checklist

Pick one critical journey, write its pass criteria, and run a single baseline load test in a production like environment this week. Add the other five test types only where a named risk justifies them. A run that simply completed has not passed, so gate only on thresholds agreed in advance.

  • Choose one journey, such as checkout at expected peak.
  • Set example targets: p95 latency, error rate, and CPU and memory limits.
  • Get written approval for the environment and the maximum number of VUs.
  • Seed isolated test data for each virtual user.
  • Commit checkout-load.js with its thresholds and run it in CI.
  • Report request count next to every percentile.
  • Save the first good run as your baseline and compare each candidate against it.

Bottom line

Each test type answers one question. Load checks expected peak, stress finds the breaking point, spike checks sudden surges, soak exposes slow leaks, scalability checks that capacity grows with resources, and volume checks behavior on large data sets. Write the goal, traffic shape and pass criteria before any run, then compare each candidate against a baseline from an equivalent environment. For tooling, see our performance testing tools guide.

Sources

These primary sources back the statistics, thresholds and tool behavior cited above. Check each figure, its date and its method before reusing it in your release criteria.

Share the Post:

Author

Deep Barot

CEO @ ContextQA | Agentic AI for Software Testing | Context-aware Testing

Deep Barot is the Founder and CEO of ContextQA, the only AI testing platform that understands context. He brings decades of experience across DevOps, full-stack engineering, cloud systems, and large-scale platform development.
AI Insights
Real User Intelligence Platform

Turn live sessions into test coverage. No prompts, no manual design - just pointed at your URL and generating suites within minutes.

Minutes
From URL to generated test cases
Zero
Prompts or manual test design needed
40%+
Average coverage increase after first run
100%
Based on real user behavior, not guesses

Frequently Asked Questions

Not on their own. AI tools can draft scenarios and flag anomalies, but only a load test that replays your expected peak checkout traffic on a production like environment shows how checkout will actually hold up. Your team still sets the pass criteria.
Load testing checks whether your web app meets latency and error targets under a defined traffic shape. Chaos engineering injects faults, such as a killed pod, added network latency or a failed dependency, to check that the system degrades gracefully and recovers. Load testing proves capacity. Chaos engineering proves resilience.
Compare what automated load runs cost with the incidents and release delays they prevent. Track latency and capacity incidents per quarter, time from candidate build to load verdict, engineer hours per run, and how many regressions baseline comparisons caught before release.
Related Blogs