Load testing

Play this lesson

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

These are the names used by k6, Grafana's load testing tool.

Pick the test

#beta-feedback, @mossknight
Garden saves were instant on Saturday morning but took 10 seconds by Sunday night.

Which test would have caught this before the beta?

  1. A soak test
  2. A smoke test
  3. 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

beta-weekend.js
export const options = {  // 2,000 VUs for 30 min  thresholds: {    http_req_duration:      ['p(95)<300'],    http_req_failed:      ['rate<0.01'],  },};

Remy's run ends with p95 at 340 ms and 0.4% errors. What does k6 report?

  1. The duration threshold failed, and k6 exits with a non-zero code
  2. Everything passed, because errors were under 1%
  3. 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

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.

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