StoicBuilder

HandbookXIII the AqueductLoad testing

XIIIthe Aqueduct, Scale it

Load testing

1 min readUpdated 28 November

In plain words

Load testing sends realistic, rising traffic at a copy of your system with a tool like k6, so you learn the point where latency and errors climb, and which part gives way first.

Where you see it

Before Black Friday, Harbor's team runs a k6 script against staging that ramps up to 800 virtual users over 15 minutes. At 450 users p95 latency jumps from 300 ms to 4 seconds, and the database dashboard shows every connection in use.

load/projects.jsterminal
import http from "k6/http";import { sleep } from "k6";export const options = { stages: [{ duration: "5m", target: 200 }, { duration: "10m", target: 800 }, { duration: "5m", target: 0 }], thresholds: { http_req_duration: ["p(95)<800"], http_req_failed: ["rate<0.01"] },};export default function () { http.get(`${__ENV.BASE_URL}/api/projects`, { headers: { Authorization: `Bearer ${__ENV.TOKEN}` } }); sleep(1);}
Ramp up, hold, ramp down, and fail the run if p95 passes 800 ms or more than 1 percent of requests fail. Run it with k6 run.

What goes wrong

  1. A staging copy that looks nothing like production

    A staging database with a thousand rows on one small server tells you little about production with 40 million. Match data size and instance sizes, or be careful how you scale the results.

  2. Every virtual user loading the same page

    One URL with the same ID is served from cache and looks wonderful. Mix routes, accounts and data the way real traffic does, including sign-ins, writes and searches.

  3. Measuring only from the load generator

    The test says p95 went bad at 450 users, not why. Watch server metrics, database connections and queue depth during the run, so you can name what broke first.

What to tell your agent

Copy this into Lovable, Bolt, Cursor or any agent
Write a k6 load test for our three busiest routes, with realistic think time and a pool of test accounts, ramping to 4 times our current peak. Add thresholds for p95 latency and error rate, stub or sandbox every third-party call, and make the script refuse to run if BASE_URL points at production.

Quick check

Sign in to earn +10 XP for it

Harbor's load test shows p95 latency jumping at 450 virtual users while app server CPU sits at 35 percent. What do you check next?

Got a prompt that touches load testing?

Paste it. You get a better prompt first, then the cards that explain it.

Check your own prompt

Free, no sign-up.