Q28 of 38 · Performance

What is a ramp-up period in a load test and why does it matter?

PerformanceMidperformanceramp-upk6load-testingstages

Short answer

Short answer: A ramp-up period gradually increases virtual users from zero to the target load over a defined time, rather than hitting full load immediately. It allows caches to warm, connection pools to fill, and JIT compilers to optimise — giving a result that reflects steady-state performance, not cold-start behaviour.

Detail

Without a ramp-up, the first seconds of a test produce a cold-cache, empty-connection-pool spike that is unlikely to represent production behaviour. The system appears to fail at a load level it handles fine under normal conditions, leading to false bottleneck diagnoses.

A typical ramp-up strategy for a target of 500 VUs:

  • 0–2 min: 0 → 100 VUs (warm caches, establish baseline)
  • 2–4 min: 100 → 300 VUs (detect early degradation)
  • 4–6 min: 300 → 500 VUs (approach target)
  • 6–16 min: 500 VUs steady state (collect main metrics)
  • 16–18 min: 500 → 0 VUs (ramp-down, observe recovery)

In k6, this is the stages configuration. Report your SLO metrics only from the steady-state phase — including the ramp-up in percentile calculations inflates p95/p99 with cold-start latencies.

// EXAMPLE

k6-stages.js

export const options = {
  stages: [
    { duration: "2m", target: 100 },  // ramp up
    { duration: "2m", target: 300 },
    { duration: "2m", target: 500 },
    { duration: "10m", target: 500 }, // steady state — measure here
    { duration: "2m", target: 0 },    // ramp down
  ],
};

// WHAT INTERVIEWERS LOOK FOR

Knowing the purpose of ramp-up (cache warm, connection pools, JIT). Reporting SLO metrics from steady state only. The ramp-down phase as a recovery observation.