Skip to content
Tutorials Center
My learning

Topics

Lesson 34 of 37 ยท CI and Best Practices

Performance Test Types and How to Plan a Test Strategy

Learn the performance test types (smoke, load, stress, spike, soak, scalability), how to define goals and workload models, and how to size a test with Little's Law.

"We ran a load test" can mean ten different things. A test that holds 100 users for ten minutes answers a different question from one that ramps until the system breaks, or one that runs for a day. Before you open JMeter you need a strategy: which questions are you answering, with what load, against which success criteria? This lesson names the test types, shows how to model the workload from production numbers, and gives a calculator for translating business targets into JMeter settings. JMeter cannot run on this site; the code is a runnable stand-in.

The test types

Know your test type

Smoke A few users, one pass: does it work at all?
Load Expected peak: meets the goals?
Stress Beyond peak: where and how does it break?
1 / 2
Type Load shape Question it answers Typical duration
Smoke 1 to 5 users Do scripts and environment work? minutes
Load ramp to expected peak, hold Are response times and error rates within goals at normal peak? 15 to 60 minutes
Stress ramp past peak in steps until failure What is the breaking point and how does the system fail (gracefully or not)? 30 to 90 minutes
Spike instant jump (for example 10x) then drop Does it survive a sudden surge and recover quickly? 10 to 30 minutes
Soak (endurance) moderate steady load Memory leaks, connection leaks, disk growth, slow degradation 4 to 24+ hours
Scalability repeat a load test with more resources Does adding servers or CPUs give proportional capacity? per configuration
Breakpoint / capacity continuously increasing load Maximum sustainable throughput until limit

In JMeter: use a Thread Group for simple profiles, the Stepping Thread Group, Ultimate Thread Group or Concurrency Thread Group (plugins from the JMeter Plugins project) for steps and spikes, and the Precise Throughput Timer or Constant Throughput Timer to hold a fixed request rate.

Define goals first

A load test without acceptance criteria produces charts, not answers. Write requirements like this:

  • Throughput: 400 orders per hour at peak, 150 searches per second.
  • Response time: p95 of search below 800 ms, p99 below 2 s, checkout p95 below 3 s.
  • Errors: below 0.5 percent, and no 5xx at the target load.
  • Resource limits: CPU below 70 percent, memory not growing over 8 hours, database connections below 80 percent of the pool.

If nobody can tell you the numbers, derive them: take production analytics (peak hour requests, user count), add growth (for example 2x in a year), and add a safety factor. Ask the business what is acceptable; "as fast as possible" cannot be tested.

Workload modelling

Describe the user population as a set of scenarios with weights:

Scenario Share Steps Think time
Browse 60 percent home, category, product 3 to 8 s
Search 25 percent home, search, product 3 to 6 s
Purchase 10 percent login, cart, checkout 5 to 10 s
Account 5 percent login, orders 3 to 6 s

Each scenario becomes a Thread Group or a Throughput Controller branch, with thread counts proportional to the share. Production access logs, analytics tools and APM data are the best source for these numbers.

Sizing with Little's Law

Little's Law links the number of concurrent users N, the arrival rate (throughput) X, and the time each user spends in the system per iteration R (response time plus think time):

TEXT
N = X x R

If you want 20 iterations per second and one iteration takes about 30 seconds including think time, you need 20 x 30 = 600 concurrent threads. Alternatively, if you have 600 threads and each iteration takes 30 seconds, throughput will be about 20 per second (as long as the server keeps up).

Python Stand-in: turn business targets into JMeter settings

Press Run (or Ctrl + Enter) to see the result here.

Program input ยท what you'd type while the program runs

Type the answers before you press Run, one per line. Each time the program reads a line (with input()), it gets the next line from this box.

These totals tell you how many threads to configure, the request rate to expect on the server and, with the response-time goals, whether one generator is enough (sizing agents).

Open versus closed workload models

A classic Thread Group is a closed model: a fixed population loops, so when the server slows down, arrivals slow down too. Real public websites are closer to an open model: new visitors arrive at a rate that does not depend on how the server feels. To test the open model, use arrival-rate timers (Precise Throughput Timer with a Concurrency Thread Group that has enough spare threads). Closed models are fine for internal systems with a fixed number of users.

A staged approach

  1. Smoke the scripts with one user, with View Results Tree.
  2. Baseline with low load for response times with no contention.
  3. Load at the target peak; check goals.
  4. Stress in steps (50, 100, 150 percent of peak) to find limits.
  5. Soak at 60 to 80 percent of peak for hours.
  6. Tune and repeat: change one thing at a time and re-run the same test.

Keep a written test report: goals, environment, scenarios, results against goals, bottlenecks found, and recommendations.

Check your understanding

Quick check ยท 4 questions

of 4 answered You scored / 4 ยท perfect!

  1. 1. Which test type is designed to find memory leaks?

    A long run at steady load shows slow growth in memory, connections and disk.
  2. 2. 20 iterations per second, each lasting 30 seconds with think time. How many concurrent users?

    Little's Law: N = X x R = 20 x 30 = 600.
  3. 3. What is a spike test?

    Spike tests check behaviour and recovery when load jumps abruptly.
  4. 4. Why define acceptance criteria before testing?

    Without goals, a test only produces numbers with no verdict.

Summary

  • Choose the test type by the question: smoke, load, stress, spike, soak, scalability, breakpoint.
  • Write measurable goals for throughput, percentiles, errors and resources.
  • Model scenarios with shares from production data; size with Little's Law.
  • Closed models slow down with the server; open models keep arriving.
  • Work in stages and change one thing at a time.

Next: Project: Load Testing a REST API