Skip to content

Load, stress and endurance tests: how they differ

B2Bnetwork team · · 6 min

System performance

In brief

A load test checks whether the system meets requirements at expected traffic, e.g. in the peak hour. A stress test raises traffic above the forecast until the system stops keeping up, and shows where the limit lies, how the system fails and whether it recovers on its own. An endurance test holds typical load for many hours and catches memory leaks, growing queues and filling disks. Each answers a different question, so a good plan combines all three.

Three questions, three types of tests

The type of test follows from the question you want to answer, not from the tool. The same JMeter script can serve any of them; what changes is the load profile and duration.

Test typeQuestionLoad profileTypical durationWhat usually turns up
LoadCan we handle the expected traffic?Ramp up to the forecast peak and hold30–90 minutesQueries that are too slow, a connection pool that is too small, configuration errors
StressWhere is the limit and how does the system fail?Stepwise ramp above the forecastUntil the first failure and a little longerThe first resource to run out, error cascades, no traffic limiting
Endurance (soak)What breaks only after hours?Typical load held for a long time8–72 hoursMemory leaks, growing tables and logs, degradation after batch jobs

The durations in the table are indicative values from practice, not a norm. The ISTQB Performance Testing syllabus describes these test types alongside several related ones, covered below.

Load test: can we handle the expected traffic

A load test reproduces the traffic the system should expect and compares results with requirements. It starts with business numbers: how many customers log in during the worst hour, how many transfers, activations or orders go through in that hour, and what the proportions between paths are. In internet banking these will be login, balance view, history and transfer; at a telecom operator, service activation and order status checks.

The result of a load test is a yes or no answer to a specific requirement, e.g. “95% of transfers complete in under 1.5 s at 120 transfers per second, and the error rate does not exceed 0.1%”. That is why requirements are written in percentiles, not averages; more on this in the article Percentiles instead of averages.

What to watch out for:

  • The load model. A generator that waits for a response before sending the next request slows down by itself when the system slows down and hides the problem. Internet traffic arrives regardless of whether the server keeps up, so a sales peak is better modeled with a constant request arrival rate.
  • Warm-up. The first minutes after the application starts (empty caches, JIT compilation) skew results downward. The warm-up period is described in the plan and excluded from evaluation.
  • Data. A hundred logins with the same user give results from the cache, not from the database.

Stress test: where is the limit and how does the system fail

A stress test deliberately exceeds the forecast, usually in steps: 100%, 150%, 200% of peak and beyond, until one of the measures stops meeting the requirement or errors appear. We are interested in three things: at what load the system stops keeping up, which resource runs out first (database CPU, connection pool, external API limit, queue throughput) and what the failure looks like.

A good failure is predictable. The system rejects excess requests with a fast message, queues have limits, and after traffic drops everything returns to normal without a restart. A bad failure means response times growing until timeouts are exceeded, clients retrying requests, which adds traffic, and services that have to be brought back up by hand. A stress test should always end with a phase of returning to normal load, because that is what shows whether the system rebuilds itself.

Endurance test: what breaks only after hours

An endurance test holds a typical, not peak, load for many hours. It looks for defects a short test will not see, because they build up slowly:

  • process memory grows and after a few hours frequent garbage collection starts or the process gets killed,
  • session, log or queue tables grow and queries on them slow down,
  • connection pools lose connections that nobody returns,
  • a nightly batch job overlaps with traffic and slows the system long after it finishes.

In systems that run around the clock, such as operator billing or a payment system, the endurance test also covers batch job windows and log rotation. What is assessed is not only response times but also the trend in memory, disk and connection use: a flat line means a healthy system, a rising one means a problem, even if times still meet the requirements.

Related variants: spike, scalability and capacity

Besides the three main types, these are also useful:

  • Spike test. Traffic jumps within seconds from typical to many times higher, as after sending a notification to all app customers or when registration opens in an enrollment system. It checks autoscaling, cache warm-up and queues.
  • Scalability test. Measures how much throughput each added node gives. It is rarely a linear relationship, because a shared database or locks quickly become the bottleneck.
  • Capacity test. Determines how many users or transactions the system can handle while meeting requirements. Its result is an input to capacity planning.

How to arrange them in one plan

The test types are arranged in an order where each next one uses the results of the previous one:

  1. A short smoke test: do the scripts, data and monitoring work.
  2. A load test at the forecast level: a baseline result and a first list of fixes.
  3. A stress test: the system's limit and behavior at failure.
  4. A spike test, if traffic arrives in waves.
  5. An endurance test, usually at night or on the weekend.
  6. A repeat of the load test after fixes, to compare the result with the baseline.

Such a plan is used before a core system migration, a product launch or a sales peak; the article Performance test before a sales peak describes it step by step. What such a plan looks like in a bank project is shown by the case study Full performance testing of internet banking before a core system migration.

Questions and answers

Are a load test and a performance test the same thing?

No. A performance test is the name of the whole family of tests that measure response times, throughput and resource use. A load test is one of them: it checks behavior at expected traffic. The same family includes stress, endurance, spike, scalability and capacity tests.

How long should an endurance test last?

Long enough to cover phenomena that build up slowly in the system. For an application with a daily work cycle a reasonable minimum is a few hours, and for systems with nightly batch jobs at least a full day, so the test goes through the batch window. If the memory usage trend is still rising at the end of the test, it is worth extending it.

Can a stress test be done in production?

Usually not, because its purpose is to push the system to its limit, which risks failure for real customers. A stress test is done on an environment close to production. In production you do at most careful load tests outside traffic hours, with test accounts and a plan for immediate abort.

Which test should we start with when time is short?

With a load test at the forecast peak level, because it answers the question the business asks: will the system handle the expected traffic. If time remains, the next should be a stress test, which shows the headroom and the way of failing. An endurance test can be run overnight, in parallel with analyzing the day's results.

What it looks like in a project

Your system slows down under load? We'll find where it loses time.

Let's talk

Read more: System performance