Spike Tests
Spike tests apply a sudden surge of traffic to verify autoscaling, queues, and recovery cope with sharp load changes rather than steady growth.
Definition
A spike test is a load test that raises traffic abruptly to a high level for a short period, then drops it, to observe elasticity and recovery.
Context and scope
Used before launches, flash sales, scheduled events, and workloads whose traffic arrives faster than autoscaling can react.
Common misconceptions
- Spike testing is only about measuring maximum throughput
- If average load passes, a sudden spike will also pass
- Spike testing is the same as a development spike
Anti-patterns
- Ramping traffic gradually and calling the result a spike
- Measuring only during the surge and not during recovery
- Ignoring cold starts, queue backlog, and downstream rate limits
Related concepts
Related examples
Authoritative source
https://grafana.com/docs/k6/latest/testing-guides/test-types/spike-testing/
What it tests
A spike test jumps traffic from baseline to a high level almost instantly, holds it briefly, then drops it. The question is not “what is the maximum throughput” but “what happens when demand changes faster than the system expects”. Autoscalers need time to react; caches are cold; connection pools are sized for baseline; queues absorb the difference and may never drain. A spike test exposes that sequence.
Designing the test
Start from a realistic baseline, then apply a steep ramp, often within seconds or a couple of minutes. Hold long enough for autoscaling to trigger and for queues to build, then return to baseline and keep measuring. Include the recovery window, because systems often fail after the spike rather than during it: a backlog of retries, a thundering herd of reconnects, or a database still catching up. Compared to a soak test, this is short and violent rather than long and steady.
What to watch
Track error rate and latency during both the surge and the recovery. Watch queue depth, consumer lag, autoscaler events, cold-start duration, and rate-limit responses from dependencies. Check whether retries amplify the load. A system can survive the spike and then collapse when every timed-out client retries at once.
Spike versus development spike
The same word describes a time-boxed investigation in agile planning. Context disambiguates: a load spike measures capacity, while a development spike reduces technical uncertainty. This article concerns the load-testing meaning.
Limits
Spike tests can harm shared environments and downstream partners, so isolate them and warn owners. They do not replace capacity planning or load shedding design. For example, a service may pass a single spike and still fail during a real event with a different traffic mix. Use results to tune limits and autoscaling policy, not as a one-time certificate.