k6 load testing

Run a distributed load test

Hard120 pts~45 min
  • Distributed load
  • Execution segments
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-run-a-distributed-load-test

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

Objective

Split one test across simulated load generators by partitioning VUs, as distributed k6 does with execution segments.

Your task

  1. 1Set options { vus: 20, iterations: 200 }.
  2. 2const generator = __VU % 2: generator 0 runs search, generator 1 runs checkout.
  3. 3Tag each request with { tags: { generator: String(generator) } } and check status 200.
  4. 4sleep(0.2) between iterations.

Acceptance criteria

  • Search and checkout return 200
  • VUs are partitioned with __VU
  • ≥ 150 requests with error rate < 5%
  • At least 150 check() calls pass

Constraints

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

k6 load testing · Performance Testing · Scaling & analysis