Spike Testing

Simulate sudden traffic surges

Model sudden, dramatic increases in traffic — like a product going viral or a flash sale starting. Verify your auto-scaling works, your caches hold, and your users get served.

What you get

  • Instant traffic ramp-up scenarios
  • Test auto-scaling and CDN behavior
  • Measure recovery time after spikes
  • Identify cascade failures
  • Custom spike patterns and durations
  • Real-time monitoring during spikes
spike-test.js
import http from 'k6/http';
import { sleep } from 'k6';

export const options = {
  stages: [
    { duration: '30s', target: 10 },   // Warm up
    { duration: '10s', target: 200 },   // SPIKE!
    { duration: '1m', target: 200 },    // Hold spike
    { duration: '10s', target: 10 },    // Recovery
    { duration: '30s', target: 10 },    // Verify recovery
    { duration: '10s', target: 0 },     // Ramp down
  ],
};

export default function () {
  http.get('https://myapp.com/api/products');
  sleep(1);
}

Frequently Asked Questions

What's the difference between spike and stress testing?

Stress testing gradually increases load to find the breaking point. Spike testing instantly jumps to high load to test how your system handles sudden surges and recovers afterward.

How fast can VUs ramp up?

k6 can ramp from 0 to your VU limit in seconds. The 10-second stage in the example above jumps from 10 to 200 VUs almost instantly — perfect for simulating viral traffic.

Ready to start spike testing?

Sign up free — no credit card required. Get 200 VUs and 5 minute tests instantly.

loadtest.dev

© 2026 loadtest.dev