Establishing a k6 Load Test Baseline
Smoke, load, stress, and soak scenarios — the four scripts we run before every major release.
Without a baseline, “it feels slower” is not actionable.
Scenarios
// smoke.js — 10 VUs, 1 minute
export const options = { vus: 10, duration: '1m' };
// load.js — ramp to 500 VUs over 10m, hold 20m
export const options = {
stages: [
{ duration: '10m', target: 500 },
{ duration: '20m', target: 500 },
{ duration: '5m', target: 0 },
],
};
Metrics We Track
- P50 / P95 / P99 latency
- Error rate (threshold: <0.1%)
- RPS at saturation point
- CPU/memory per pod at 500 VUs
CI Integration
Load tests run nightly against staging, not every PR (too slow). PRs run smoke only (~2 min). Release candidates run full load + 2-hour soak.
Baseline JSON checked into repo. Regression >10% on P99 blocks release until investigated.
load-testing , k6 , benchmarks · Go , Kubernetes