---
title: "Performance Testing Guide: Load, Stress and Spike Tests Done Right"
description: "The differences between load, stress, spike and soak testing, the metrics that matter (p95, error rate, throughput) and how to design realistic scenarios."
url: https://sanderyaz.com/en/blog/load-testing-guide/
author: Sander Yazıcıoğlu
date: 2026-12-02
updated: 2026-12-02
lang: en
tags: ["Performance testing","Load testing","QA","Backend"]
---

# Performance Testing Guide: Load, Stress and Spike Tests Done Right

While building the interface of a cloud load-testing platform at Loadium, I saw how hundreds of teams set up their tests and read their results. The most common mistake is not choosing the wrong tool; it is **asking the wrong question**. This guide helps you start performance testing with the right ones.

## First, the question: what do you want to learn?

"How many users can our site handle?" is not a good question, because the answer depends on what users do. Better questions:

- When **2,000 orders a minute** arrive on campaign day, does checkout stay under 2 seconds?
- At **3x normal traffic**, which component becomes the bottleneck first?
- Under moderate load for **8 hours**, is there a memory leak?

Each question maps to a different kind of test.

## Test types

| Type | What it does | Question it answers |
|---|---|---|
| Load test | Applies expected traffic | Do we meet targets on a normal and a busy day? |
| Stress test | Ramps load until something breaks | Where is the limit, and how does it fail? |
| Spike test | Applies a sudden, short surge | What happens on a campaign, push notification or TV ad? |
| Soak (endurance) | Holds moderate load for hours | Memory leaks, exhausted connection pools? |
| Capacity test | Increases load step by step | How many servers do we need to hit the target? |

## The right metrics

### Averages lie; use percentiles

A system with a 400 ms average response time may still make 5% of users wait 4 seconds. Look at **p95 and p99**: "95% of requests completed under X ms".

### The core four

1. **Response time** (p50, p95, p99)
2. **Throughput**: requests or transactions per second
3. **Error rate**: HTTP 5xx, timeouts, wrong content
4. **Resource usage**: CPU, memory, database connections, queue length

When load goes up but throughput stops rising and response time climbs fast, you have hit the **saturation point**. Knowing that point is the basis of capacity planning.

### Write targets up front

Before the test, write down the success criteria: "The payment API keeps p95 < 800 ms and error rate < 0.5% at 2,000 orders per minute." Without a target, every result looks "not bad".

## Designing realistic scenarios

### Model user journeys

Real users don't just refresh the homepage: they search, browse products, add to cart, and some buy. Pull journey ratios from your analytics (say 60% browsing, 30% search, 10% checkout) and build the scenario to match.

### Think time and ramp-up

- Add **think time** between steps, or 100 virtual users behave like 1,000 real ones.
- **Ramp up** load gradually rather than all at once. A sudden start measures nothing but an accidental spike test.

### Test data

Thousands of requests with the same user and the same product make the system look faster than it is, thanks to caching. Use parameterised data: different users, products and search terms.

## Choosing a tool

- **Apache JMeter**: mature, a large plugin ecosystem, scenarios can be built in a GUI. Large loads need distributed runs or a cloud platform.
- **k6**: scenarios in JavaScript, easy to add to CI/CD, light on resources.
- **Gatling**: code-based scenarios with detailed reports.
- **Cloud platforms**: for generating load from several regions, watching results live and sharing them across teams.

A simple k6 scenario:

```js
import http from 'k6/http';
import { check, sleep } from 'k6';

export const options = {
  stages: [
    { duration: '2m', target: 200 },
    { duration: '10m', target: 200 },
    { duration: '2m', target: 0 }
  ],
  thresholds: {
    http_req_duration: ['p(95)<800'],
    http_req_failed: ['rate<0.005']
  }
};

export default function () {
  const res = http.get('https://staging.example.com/api/products?page=1');
  check(res, { 'status 200': (r) => r.status === 200 });
  sleep(Math.random() * 3 + 1);
}
```

With `thresholds`, the test fails when targets are missed, which gives you an automatic quality gate in CI.

## Reading the results

- Make sure the load generator isn't the bottleneck: if its CPU is above 80%, you are measuring the test machine, not your system.
- Line up application metrics (APM, slow database query logs) with the test timeline. The answer to "why did p95 jump at 14:32?" is usually there.
- Compare each run with the previous one. A single result is no substitute for a trend.

## Conclusion

Performance testing starts before the tool: with the right question, realistic scenarios and targets written in advance. To improve perceived speed in the browser, see the [Core Web Vitals article](/en/blog/react-core-web-vitals-lcp/); for real-device mobile testing, see the [Appium guide](/en/blog/appium-real-device-testing/).

---

About the author: [Sander Yazıcıoğlu](https://sanderyaz.com/en/about/). Sander Yazıcıoğlu is a Senior Full-Stack Developer in Istanbul. At LiveTesting he builds the backend, frontend, realtime systems and Appium automation of a real-device testing platform; before that he built enterprise Angular apps at Testinium and Loadium.
