Why load test?
When it pays for itself — and when it's premature.
Load testing means deliberately hammering your API to find out what happens when traffic spikes. Most teams discover their bottleneck on launch day from a screaming Slack channel. This course is the alternative: find it on Tuesday afternoon, with coffee, and fix it.
What load testing answers
- How many concurrent users can my API handle? 50? 5000? You should be able to answer this with a number.
- Where does it break? DB CPU, connection pool, app CPU, memory, downstream service?
- What does the user experience look like under load? p95 = 200ms? 2s? 20s? The difference matters.
- Does my change make things WORSE? Run before + after; the numbers tell you.
The five test types
Test types over time
- Smoke — 10 VUs for 1 min. "Does this basically work?" Run on every PR.
- Load — expected production traffic for 5-10 min. "Does it hold up at planned scale?"
- Stress — ramp until it breaks. "Where's the cliff?"
- Spike — sudden 10x surge. "Does a marketing email crash us?"
- Soak — moderate load for hours. "Do we leak memory / connections over time?"
When NOT to load test
Load testing has a cost: time to write, infrastructure to run, signal to interpret. Skip it if:
- You have <100 daily active users. Your DB isn't the bottleneck — feature velocity is. Build first.
- You haven't shipped anything. "What if a million users come?" is a great problem to have later. Don't pre-optimise.
- The endpoint is rarely called. A quarterly-reporting endpoint doesn't need to handle 1000 rps. Test the hot paths, ignore the cold ones.
What we'll build together
- A k6 suite in
tests/k6/with one script per scenario type. - Thresholds that fail the build on regression.
- A workflow that runs k6 on every PR via GitHub Actions.
- One real measured optimisation against your own API.
The mindset shift
Most performance work is vibes-based: "feels faster", "should be quicker". Load testing is the discipline of replacing vibes with numbers. You make a change, you run the test, the number went down — or it didn't. The graph is brutal honest. That's the whole point.
Quick check
What's next
Next lesson — Install k6. One binary, no Node, no deps. We'll have you running a test by the end of the next 3 minutes.
Spot a typo? Have an idea?
Help us improve this lesson. One click opens a GitHub issue with the lesson URL pre-filled — suggest clearer wording, report a bug, or request more depth. The course keeps improving thanks to learners like you.
Suggest an improvement on GitHub