k6 load testing

Distinguish load, stress, and soak tests

Easy30 pts~12 min
  • Load testing
  • Stress testing
  • Soak testing
Practice app · Checkout Service

A load-testable checkout service with realistic latency that degrades under concurrency, plus a live metrics view.

BASE_URL
/api/practice
Console app
/lab/performance-testing-distinguish-load-stress-and-soak-tests

Your starter code already declares BASE_URL — call the API relative to it.

Objective

Write one k6 script whose stages model a load phase followed by a stress spike against the checkout service.

Your task

  1. 1Declare options.stages: ramp to 5 VUs over 4 s (load), hold 4 s, spike to 25 VUs over 4 s (stress), ramp to 0 over 3 s.
  2. 2In the default function GET BASE_URL + "/perf/checkout" and check status is 200.
  3. 3sleep(1) between iterations.
  4. 4Add a comment describing how a soak test would differ (same load, hours long).

Acceptance criteria

  • GET /perf/checkout returns 200
  • The script declares stages
  • ≥ 40 requests are sent
  • At least 20 check() calls pass

Constraints

  • Runner limits: ≤ 50 VUs, ≤ 400 requests and ≤ 20 s per run — size options accordingly.

k6 load testing · Performance Testing · Foundations