· Engineering notes

How to scope a SaaS load test before you write k6

Fill the inputs, pick the traffic model that does not lie for your API, and define what "fail first" means ? then script. This hub ties our k6 notes and Lab tools into one pass/fail workflow.

Assertwise lab: sample k6 threshold results card
Lab sample thresholds - not a client run.

Stop if you cannot answer these four inputs

Before you open k6, write one line for each:

  1. Peak demand ? peak requests/sec or peak concurrent sessions for the critical API path you care about (from prod metrics, not a guess).
  2. SLO ? p95 (or p99) latency and error budget for that path.
  3. Critical path ? the 1?3 HTTP flows that lose money or trust if they fail (login ? create ? pay is a common chain).
  4. Data rules ? unique users, tenant isolation, and whether the test may write to a shared staging DB.

If (1) or (2) is missing, fix observability first. A green load test against an unknown SLO is theatre.

Artifact: SaaS load-test scoping checklist

## Load scope ? fill before scripting
Critical path:
Peak RPS / concurrent sessions:
p95 SLO (ms) / max error rate:
Environment (staging size vs prod %):
Write traffic allowed? (Y/N) + cleanup plan:
Auth model (token farm / login VU):
Success checks (status + business assertion):
Abort rules (when to stop the run):
Owner + date:

Decision table: closed VU vs arrival-rate

UseClosed model (VUs wait on responses)Arrival-rate / open model
Traffic looks likeA fixed pool of users clicking when freeIndependent arrivals (checkout spikes, webhooks, API clients)
Lies whenLatency rises: throughput collapses and you under-report queueingYou forget think time / correlation and stampede a login endpoint
Prefer whenHuman UI sessions with natural pacingAPI backends, partner traffic, marketing spikes
k6 starting pointconstant-vus / ramping-vusconstant-arrival-rate / ramping-arrival-rate

Deep dive on coordinated omission and arrival-rate: realistic load tests with k6. Tool choice: JMeter vs k6.

?What fails first? checklist

Rank these before you chase p95 on a single happy-path GET:

  • Connection pools (app ? DB / Redis) exhausted
  • Auth/token endpoint saturates and poisons every scenario
  • Queue consumers lag while HTTP still returns 200
  • Row locks / unique constraints under write load
  • Autoscaling cool-down: cold pods during spike
  • Rate limits / WAF trip on synthetic IP ranges

Your report should say what broke first, not only ?p95 was 812 ms?.

Pass/fail thresholds you can paste

Official docs: k6 thresholds, executors. Example only ? replace numbers with your SLO:

export const options = {
  thresholds: {
    http_req_failed: ['rate<0.01'],
    http_req_duration: ['p(95)<500'],
    checks: ['rate>0.99'],
  },
};

How to read the output without vanity graphs: reading performance test results.

Lab path (free tools on this site)

  1. Capacity calculator ? turn concurrent users + think time into rough RPS.
  2. SLO & error budget calculator ? know what 99.9% allows before you set thresholds.
  3. k6 script generator ? first script from OpenAPI or curl.
  4. Load test results analyzer ? turn k6/JMeter exports into a short summary.

When to involve Assertwise

If you need a scoped load engagement (workload model, scripts in your repo, capacity statement, re-test after fixes), see load & stress testing or book a free 20-min test audit ? leave with the three highest-risk load scenarios for your stack.

Before scoping traffic: SLO and error budget before load.

Pool saturation pattern: connection pool exhaustion k6 check.