
What is Spike Testing?
Spike Testing is a software testing method where the application is tested with sudden,
extreme increases and decreases in traffic. The goal is to assess how the software handles sudden changes in user load and how quickly it recovers. It helps identify weaknesses in the application.
When to perform a spike test
Spike testing is crucial when a system expects a sudden surge in activity.
It helps determine if the system can handle the unexpected load, which is much higher than usual and may target different processes than other tests.

Goal of Spike Testing
Spike testing aims to assess how a system handles sudden surges and drops in user load and measures its performance under these conditions.
It also evaluates the system’s recovery time between spikes, which should be minimal.
How to do Spike Testing
Below is steps to do Spike test:
– Determine Load Capacity: Identify the maximum user load your application can handle.
– Prepare Environment: Set up the test environment to monitor performance metrics.
– Define Load: Use a performance testing tool to apply the expected maximum load.
– Increase Load: Rapidly spike the load on the system for a short period.
– Return to Normal: Gradually bring the load back to normal levels.
– Analyze Results: Review performance data like failures, response time, and user impact.
Metrics to monitor during spike test
System stability: to ensure the system can handle the load during spike test without failure and recovery after spikes.
Response time: how quickly the system response to the request during spike test and after spike test
Error rate: if the system return a large number of failure request, this should be investigated as this is a signal that the system can not deal with the high load.
Throughput: the number of transactions, request the system handle during the test. If there is a drop in throughput, it shows that the system struggle to handle the high load.
Resource usage: monitor the server CPU, memory, disk I/O during and after spike test to know if there is bottle neck and helping in understanding the resource limits for future scaling.
Common scenarios for using spike test
There are many situations that need to do spike test, for example:
– When an eCommerce store offers big discounts, like on Black Friday.
– When a web app is live streaming a popular TV show.
– During a flash sale on a daily deal website.
– When content on a site goes viral.
– When a new system goes live and many users try to access it at once.
– After a power outage, all users log back in to the system at the same time.
Spike testing example
The key differentiator of the spike test are the simulation of sudden and very high loads. It lacks a plateau (full load) duration or is usually brief.
Sometimes, the test may require a load plateau for some time. If a plateau is needed, it’s generally short.
A ramp down can also be quick or unnecessary as the goal is to suddenly increase the system’s load.
Below is a load testing example using Grafana k6 to perform a spike test:

In a spike test, load quickly increases to an extreme level. The ramp-down period follows when the test reaches the maximum, returning to 0 quickly.

Advantages and Disadvantages of Spike testing
Advantages:
Software performance must be maintained, even under extreme load increases, where issues are more likely. Spike testing helps evaluate these scenarios. Standard testing may not cover worst-case situations, but ignoring them doesn’t mean they won’t happen. Spike testing prepares software for heavy, sudden loads and helps minimize the risks.
Disadvantages:
The main drawback of Spike Testing is that it’s expensive because it requires special test setups. However, in the long run, it provides a good return on investment (ROI).
Spike Testing Tools
1) JMeter
The Apache JMeter is a java open source spike testing tool. It is specially designed to load functional test behaviour and measure performance. This performance testing tool can be used to analyse and measure the performance of web application or a variety of services. Today, it is widely used for the functional test, database server test.
2) K6
K6 is a load testing tool for Windows and Linux, which allows spike testing of web and other apps. It helps to determine the performance and result of the application even under the heavy load.
3) Other performance testing tools: Gatling, BrowserStack App Performance, LoadRunner, BlazeMeter, Locust, NeoLoad,…
Conclusion
Spike testing is a type of software testing in which a software application is tested with extreme increments and decrements in traffic load. The right approach to do spike testing is to unexpectedly increase the number of users followed by an immediate decrease in the load. The unexpected load is the main attribute of the deal. JMeter is one such useful tool to do spike testing.
Reference
https://grafana.com/blog/2024/01/30/spike-testing
https://www.soapui.org/learn/load-testing/5-load-testing-scenarios-for-your-api/
https://martkos-it.co.uk/blog/spike-test
https://queue-it.com/blog/spike-testing/
https://www.javatpoint.com/spike-testing
https://www.blazemeter.com/blog/stress-testing-vs-soak-testing-vs-spike-testing