Load testing
A streamer says yes
A big streamer agrees to play Shard Garden live during the beta weekend. That could mean thousands of players joining gardens within minutes. Will the matchmaking server and the garden save service hold?
A load test sends large numbers of fake players at our servers on purpose, before real ones arrive. Course 1 told the story of Pokémon GO's launch. This lesson shows how to test properly.
Six kinds of test
- SmokeA few users: does the script work, and is the system fine with almost no load?
- Average loadNormal, expected traffic.
- StressMore than the average, to see how the system behaves at its limits.
- SoakNormal load for many hours, to catch slow problems.
- Spike and breakpointSpike: a sudden, short, massive jump. Breakpoint: keep raising the load until something breaks.
These are the names used by k6, Grafana's load testing tool.
Pick the test
Garden saves were instant on Saturday morning but took 10 seconds by Sunday night.
Which test would have caught this before the beta?
- A soak test
- A smoke test
- A spike test
Show the answer
A soak test
The problem grew slowly over many hours, like a leak or a filling disk. A soak test runs normal load for a long time to find exactly that.
Virtual users and ramps
In k6, each virtual user (VU) runs our test script again and again, like a player: join a garden, plant, save. The ramping-vus setting raises and lowers how many run at once in stages.
k6's own example ramps from 0 to 10 VUs over 20 seconds, then back to 0 over 10. For the streamer, Remy plans 0 to 2,000 over 10 minutes, then holds for 30.
Pass or fail: thresholds
A percentile sorts every request by time: p95 is the time 95% of requests beat.
k6 thresholds turn goals into pass or fail. Its example: http_req_failed: ['rate<0.01'] (under 1% errors) and http_req_duration: ['p(95)<200'] (95% of requests under 200 ms). If a threshold fails, k6 exits with a non-zero code, so a CI pipeline can mark the run as failed.
Read the code
1export const options = {2 // 2,000 VUs for 30 min3 thresholds: {4 http_req_duration:5 ['p(95)<300'],6 http_req_failed:7 ['rate<0.01'],8 },9};
Remy's run ends with p95 at 340 ms and 0.4% errors. What does k6 report?
- The duration threshold failed, and k6 exits with a non-zero code
- Everything passed, because errors were under 1%
- The error threshold failed
Show the answer
The duration threshold failed, and k6 exits with a non-zero code
340 ms is over the 300 ms limit on line 5, so that threshold fails. 0.4% is under 1%, so the error threshold passes. One failed threshold fails the run.
Test the real path, safely
- Speak the real protocolShard Garden's co-op runs over WebSockets. k6 can test those too, with its k6/websockets module.
- Not on real playersLoad-test a staging copy that matches production, never the live gardens. Check your hosting provider's rules first.
- Watch the serversDuring the test, watch the servers' own numbers: CPU, memory, database time. Stage 5 builds those dashboards.
Quick check
k6's guide says to start with a smoke test: a handful of users, to prove the script works before the big run.
- True
- False
Show the answer
True
A broken script under 2,000 VUs only produces 2,000 times the noise. A smoke test checks the script and the system with minimal load first.
Fast everywhere
Shard Garden now loads fast, answers every tap, stays still, keeps its frame budget, survives long sessions on hot phones, and its servers have been tested at weekend scale. Field data will tell us if it stays that way.
Bolt says: Boss time: one quiz across the whole Speed stage.
Fact-checked 11 October 2026
- Grafana k6: Load test types grafana.com
- Grafana k6: Thresholds grafana.com
- Grafana k6: Ramping VUs grafana.com
- Grafana k6: WebSockets grafana.com