Featured project | Performance

k6 Performance Testing

Smoke, load, stress, spike and soak tests of a shop API kept in the repository; SLOs per endpoint as k6 thresholds that fail the CI job, open and closed workload models, and an HTML dashboard per run.

The stress test found the limit of the demo shop: past about 90 orders/s checkout queued without bound (p95 over 3 s). After adding load shedding, the same test stays under 650 ms.

Evidence checked 19 Nov 2026 | Performance workflow run #70

GitHub Actions workflow badge
On this page
  1. Problem and purpose
  2. Architecture
  3. Technology and tools
  4. Engineering decisions and approach
  5. Problem, decision and result
  6. Test scope and execution approach
  7. Results with dated evidence
  8. Evidence explorer
  9. Local setup and execution
  10. Workflow and reports
  11. Known limitations

Problem and purpose

Shows how I approach performance testing: one test per question, pass/fail criteria agreed up front, realistic workload models, and results that lead to a fix. The app under test, a small shop API, is part of the repository, so the tests never put load on someone else's server and every CI job measures its own copy.

Architecture

k6/tests/*.js     scenarios (who, how many, which executor) + thresholds (SLOs)
      │
k6/lib/flows.js   journeys browse() and buy(): checks, think time, business metrics
k6/lib/api.js     one function per endpoint, stable name tag per request
k6/lib/config.js  BASE_URL, PROFILE (ci | full), THINK
      │
QuickShop (app/)  started by each CI job; checkout limited by 8 "database connections"

Technology and tools

AreaTools
Load testingGrafana k6 2.3 (scenarios, executors, checks, thresholds, custom metrics)
ScriptsJavaScript ES modules (k6 runtime)
App under testQuickShop: Node.js 24 HTTP API, no dependencies, with functional tests
Reportsk6 web dashboard (HTML), Markdown summary per run, JSON of every metric
Code quality and CIESLint, Prettier, GitHub Actions: lint, smoke gate, load/stress/spike in parallel, nightly soak

Engineering decisions and approach

  • SLOs per endpoint as thresholds (p95 per endpoint, error rate, checks, business metrics): a missed SLO exits with 99 and fails the job
  • Visitors in a closed model (ramping-vus) and orders in an open model (arrival rate) in the same test; dropped iterations have a threshold
  • One login per virtual user, a different test user per VU from a SharedArray, random think time
  • Each test has a ci size for every push and a full size for a dedicated environment, side by side in the script
  • The stress test asserts graceful degradation (every order placed or refused with 503, bounded wait), not the normal SLOs

Problem, decision and result

Problem

The stress test found checkout queuing beyond about 90 orders per second, with p95 response time above 3 seconds.

Decision

Add load shedding and rerun the same stress-test profile so the comparison uses the same workload definition.

Comparable run - before

Past about 90 orders/s, checkout queued without bound and p95 exceeded 3 seconds.

Comparable run - after

After load shedding, the same test stayed under 650 ms.

Evidence checked 2026-11-19 | Performance workflow run #70

Scope: The result applies to the demo shop and linked test profile; it is not a capacity guarantee for another deployment.

Test scope and execution approach

Project-specific checks and execution details documented in the repository:

  • Five test types: smoke (gate), load, stress, spike and soak; soak samples the server's memory every 10 s
  • Finding: past about 90 orders/s checkout queued without limit (p95 over 3 s and rising); fixed with load shedding, the slowest checkout is now 624 ms
  • Regression demo: a 300 ms slower checkout passes every functional check but fails the checkout SLO (p95 425 ms vs 400 ms)
  • Markdown result table on every CI run page; HTML dashboard and JSON as artifacts
  • Design notes and 78 interview questions on performance testing and k6, linked to the code (Markdown + PDF)

Results with dated evidence

Historical performance workflow run

Performance workflow run #70

The stress test found the limit of the demo shop: past about 90 orders/s checkout queued without bound (p95 over 3 s). After adding load shedding, the same test stays under 650 ms.

Evidence checked: | Open dated evidence

Evidence explorer

Static screenshots are labelled as images; dated workflow links identify the execution evidence and its check date.

Test report screenshot. Stress test before the fix: past the limit, checkout times climb until the abort threshold stops the run. Static image; capture date is not recorded in the portfolio data.
k6 dashboard of the first stress test: response times climb without limit

Test report screenshot. Stress test before the fix: past the limit, checkout times climb until the abort threshold stops the run. Static image; capture date is not recorded in the portfolio data.

Test report screenshot. The same test after adding load shedding: response times level off and every answer is correct. Static image; capture date is not recorded in the portfolio data.
k6 dashboard of the stress test after the fix: response times level off

Test report screenshot. The same test after adding load shedding: response times level off and every answer is correct. Static image; capture date is not recorded in the portfolio data.

Test report screenshot. Regression demo: one threshold fails, so the run fails. Static image; capture date is not recorded in the portfolio data.
Markdown summary of the regression demo with the failed checkout threshold

Test report screenshot. Regression demo: one threshold fails, so the run fails. Static image; capture date is not recorded in the portfolio data.

Static material from the public repository. The linked verification record was checked 2026-11-19; that date is not a screenshot capture date.

Dated workflow record

Evidence checked 2026-11-19. Open Performance workflow run #70

Local setup and execution

npm install
npm start                               # QuickShop on http://localhost:3000
k6 run k6/tests/smoke.js
k6 run k6/tests/load.js
k6 run -e THINK=0 k6/tests/stress.js
k6 run -e PROFILE=full k6/tests/load.js  # realistic size and duration

Workflow and reports

View workflow definition.

Known limitations

  • Shared CI runners are noisy: the CI sizes catch regressions; capacity numbers need dedicated load generators and a production-like environment
  • The app under test is a demo with simulated latencies
  • The measured limit and load-shedding result apply to the repository demo shop and the linked stress-test profile.

Back to Projects