Interview Prep/SRE & Reliability/Capacity & Load Testing

You need to test the system's behaviour when traffic doubles in 30 seconds.

BeginnerScenarioCapacity & Load Testing
Answer

Situation read → A spike test with an arrival-rate executor.

What I'd do →

  1. Write a k6 scenario with ramping-arrival-rate: steady at baseline, then jump to 2x in 30s, hold, then drop.
    scenarios: { spike: { executor: 'ramping-arrival-rate', startRate: 100, timeUnit: '1s',
      preAllocatedVUs: 100, maxVUs: 500,
      stages: [{ target: 100, duration: '5m' }, { target: 200, duration: '30s' },
               { target: 200, duration: '5m' }, { target: 100, duration: '1m' }] } }
    
  2. Watch autoscaling, latency, error rate and queue depth.
  3. Compare results to SLO thresholds.

Why → Arrival-rate models reflect real traffic surges; VU-based tests underestimate them.

Interview tip → Use ramping-arrival-rate for spikes.

All SRE & Reliability questions Roadmap: SRE & incident response

More on Capacity & Load Testing