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 six test types
Test types over time
- Smoke: 2 VUs for 30 seconds. "Does this basically work, and is my script right?" Run on every PR, and run it before every other type.
- Average load: ramp to 100 VUs, hold 5 minutes. "Does it hold up at planned scale?" This is the baseline every other run is compared against.
- Stress: 4x normal, held. "How does it behave past its limits: gracefully, or not?"
- Spike: 50 to 1000 VUs in ten seconds. "Does a marketing email crash us, and does p95 come back afterwards?"
- Soak: 100 VUs for four hours. "Do we leak memory or connections over time?"
- Breakpoint: a slow climb that aborts on the first breached threshold. "What is our actual capacity number?"
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