How do I load-test an application?
A sound load-test sequence (with k6 or similar, on staging with synthetic data):
- Baseline at normal load with clean database and cache telemetry
- Ramp to the expected peak and hold it to find saturation and tail latency
- Spike to model a campaign or bot burst — overload must be bounded, not catastrophic
- Soak for memory leaks, pool exhaustion and queue backlogs
- Stress beyond the goal to find the first bottleneck and confirm graceful degradation
- Failure injection: Redis unavailable, replica lag, queue worker halted, object-store timeout, CDN cache miss
Watch p50/p95/p99 per journey, error rate, CPU/memory, database pool use and locks, queue lag and cache hit rate. Include expensive searches, upload spikes and bot scraping in the workload mix. Never load-test production without authorisation, and write acceptance criteria (for example "p95 under 400 ms at peak with under 0.1% errors") before you run.