Skip to main content
Spike testing evaluates how your system handles sudden, dramatic increases in load. It tests resilience to traffic surges like flash sales, viral content, or DDoS attacks.

Purpose

Spike tests help you:
  • Validate system behavior during sudden traffic spikes
  • Test auto-scaling responsiveness
  • Identify if the system crashes or recovers
  • Verify rate limiting and throttling mechanisms
  • Test circuit breakers and fallback strategies
Spike tests differ from stress tests by focusing on sudden load changes rather than gradual increases.

Configuration Pattern

Spike tests have rapid load increases:

Baseline

Normal operating load

Spike

10-20x increase in seconds

Recovery

Return to normal

Using the Ramping VUs Executor

The ramping-vus executor enables rapid load changes:

Spike Test Stages

1

Establish Baseline

Start with normal load to establish baseline metrics.
2

Spike

Rapidly increase to 5-10x normal load in 30 seconds or less.
3

Maintain Spike

Hold the spike for 1-5 minutes to observe sustained behavior.
4

Recovery

Return to normal load and monitor recovery.

Multiple Spike Pattern

Test resilience to repeated spikes:
Multiple spikes test whether the system can recover between surges and handle repeated stress.

Instant Spike Pattern

For testing extreme scenarios, use zero-duration stages:
Zero-duration stages create instantaneous load changes. This is extremely aggressive and may overwhelm systems. Use with caution.

Using Arrival Rate for Spikes

For more realistic spike testing, use arrival rates:

What to Monitor

Critical Metrics

System Behavior

Monitor these aspects during spikes:

Response Times

How much do they degrade during the spike?

Error Rates

What percentage of requests fail?

Throughput

Does it scale with increased load?

Recovery Time

How long to return to normal?

Best Practices

Spike Magnitude

Choose spike size based on your scenario:
  • Conservative: 2-3x normal load (test auto-scaling)
  • Realistic: 5-10x normal load (flash sales, viral content)
  • Extreme: 20-50x normal load (DDoS simulation)

Spike Duration

Shorter spikes (1-2 minutes) test immediate response. Longer spikes (5-10 minutes) test sustained resilience.

Realistic Spike Scenarios

Simulate different spike patterns:

When to Use

  • Before major events: Flash sales, product launches, marketing campaigns
  • DDoS resilience: Test protection mechanisms
  • Auto-scaling validation: Verify rapid scaling works
  • Traffic surge preparation: Viral content, breaking news
  • Capacity planning: Determine maximum burst capacity

Expected Outcomes

Healthy System Response

1

Brief Degradation

Response times increase temporarily but remain acceptable
2

Auto-scaling Triggers

Additional resources provision automatically
3

Stabilization

Performance recovers within 2-3 minutes
4

Clean Recovery

System returns to baseline after spike ends

Warning Signs

Watch for these problems:
  • Complete service outages
  • Error rates above 5%
  • Response times exceeding 10 seconds
  • System crashes or restarts
  • Inability to recover after spike ends
  • Cascading failures to dependent services

Analysis Tips

Compare Pre-Spike and Spike Metrics

Key Questions

  1. How long until the system stabilizes after the spike?
  2. What is the error rate during peak spike?
  3. Did any services crash or become unavailable?
  4. Did auto-scaling respond in time?
  5. Were there any data inconsistencies?
  6. Did the system fully recover?