Spike Testing

Spike testing: used to simulate a load spike, e.g. a high traffic event (newsletter). The load increases in a short amount of time. The result is a load spike.

Spike testing is used to simulate a load spike. For example a high traffic event triggered by a newsletter. In such a scenario the load increases in a short amount of time and the result is a load spike.

The goal of spike testing is to determine whether the system will be able to handle a dramatic change in load and to observe its behavior in terms of performance.

How to

To observe the system’s behavior under a load spike you have to increase the load in a short amount of time. In the test case definition you can use different arrival phases to increase the load. Start with an average load and subsequently define arrival phases which simulate the increased incoming traffic, followed by a reduced load to reach a normal level again.

Example

In the following example we use 3 arrival phases. One warm up phase with a load of 1 new client per second over a period of 5 minutes. The load spike is defined in the second phase with a load of 10 new clients per second for one minute. Followed by a cool down phase with a load of 1 new client per second over a period of 5 minutes.

definition.setTarget("testapp.loadtest.party");

definition.setArrivalPhases([
  // warm up
  { duration: 5 * 60, rate: 1},      // 5min, 1 new client per second

  // load spike
  { duration: 1 * 60, rate: 10 },    // 1min, 10 new clients per second

  // cool down
  { duration: 5 * 60, rate: 1},      // 5min, 1 new client per second
]);

definition.session("spike test", function(session) {
  // ...
});
Last modified May 25, 2022