Spike Testing

Applies to ReadyAPI 3.57, last modified on December 20, 2024

Spike testing helps you check how the tested server responds to a sudden spike in the number of users. The server should be able to stabilize and return to normal functioning after the spike passes.

Test Parameters

To create a spike test, use the Burst load profile. It helps you simulate a short burst of users well above the expected maximum load. After that or in parallel, run another load test to check how the server handled the spike.

If you simulate the Burst load profile with the Rate load type, the test will create a large number of virtual users coming to the server. This will simulate the sudden spike that can easily overwhelm the server.

If you simulate the Burst load profile with the VUs load type, you can specify the exact top number of users that will work with the server. The test will simulate the specified number of users, even if server responses slow down.

We recommend using the Spike load test template. By default, it will create a test with the following parameters:

Parameter Value
Duration 20 minutes, burst load spikes every three minutes for one minute
Load type VUs
Simulated load 10 virtual users base, 100 virtual users during burst
Wait time One second
Warmup time 10 seconds
Assertions Failures – Per second;
Time taken – Average;
Time taken – Max;
Created monitors Default metrics for the created monitor
Created statistics Failures – Per second;

Time taken – Average;

Time taken – Max;

Running VUs;

Here is what your test may look like:

API load testing with ReadyAPI: Sample spike test

Click the image to enlarge it.

Assertions and Server Metrics

To estimate the server performance, you can track various server-side metrics or use assertions.

Server Metrics

With ReadyAPI, you can track various server-side metrics like memory and CPU usage, the number of database requests per second, and so on. To do this, you need to configure server monitors in your load tests. For detailed information, see the topics of the Server Monitoring section.

You can check metric data on the Server Monitoring and Statistics pages of the load test inspector.

The exact metrics to be checked depend on your server type and on the type of your server applications. For information on the available metrics, see Monitor Reference.

Assertions

Below are some load test assertions that you may find useful in creating spike tests:

Assertions Description
Test Target – Time Taken Lets you control the request simulation time.
Test Steps – <Test Step Name> – Time Taken
Load Test – Failures – Total Lets you check the total number of errors that occur during the test run.
Test Target – Failures – Total
Test Steps – <Test Step Name> – Failed
Test Steps – <Test Step Name> – Transactions Lets you monitor the number of simulated transactions.
Test Target – Throughput Lets you monitor the throughput (bytes per second or transactions per second).

Example

Suppose you expect the server to handle the maximum of 40 users and your target test case runs for 10 seconds.

If you use the VUs load type, set the Burst VUs parameter to 50 and specify short burst duration. After this, measure how long it takes for the server to recover from this burst.

If you use the Rate load type, set the Burst Arriving Users parameter to five and use short burst duration. This will simulate a large influx of users on your server, and may cause the server to slow down if it is unable to handle this peak.

See Also

Burst Profile
2. Load Test Editor Interface Overview
ReadyAPI Performance Licenses

Highlight search results