GuideBeginner

Performance and Load Testing with k6

Learn the difference between "does it work?" and "does it hold up under load?" with performance and load testing using k6, the industry-standard tool. You'll cover the test types (smoke, load, stress, spike, soak), the anatomy of a k6 script and its VU (virtual user) model, the metrics that actually matter (p95/p99 latency, throughput/RPS, error rate — and why the average lies), load profiles with `stages`, and thresholds: limits that make a test PASS or FAIL automatically, like a performance quality gate. The case study is a Reservo API (`GET /rooms`, `POST /quote`, `POST /book`) running locally: since k6 isn't installed in this guide's environment, its scripts and output are shown as clearly labeled content verified against the official docs, while the real metrics (p95, RPS, error rate) are actually computed with a Python load generator hitting the API. It closes with a final project: a complete smoke → load → stress load test, with thresholds, business-flow checks (quote → book), and the CI pipeline.

64
lessons
8
modules
English · Spanish
available in
Yes
certificate
Free
access
NIEVA

Outcomes

What you'll be able to do

  • Distinguish "does it work?" (functional testing) from "does it hold up?" (load testing), and recognize the test types: smoke, load, stress, spike, and soak
  • Read and write the anatomy of a k6 script: the `default` function, `http.get`/`post`, `check()`, `sleep()`, and the VU (concurrent virtual user) model
  • Interpret the key metrics of a load test: latency percentiles (p90/p95/p99, and why the average lies), throughput/RPS, and error rate
  • Model realistic load profiles with `stages` (ramp-up, steady, ramp-down), and distinguish executors driven by VUs vs. by arrival rate
  • Define thresholds (SLOs) that make a load test PASS or FAIL as a performance quality gate, and choose the right threshold
  • Use `check()` and `group()` to verify response correctness under load, parametrize data, and correlate a full flow (quote → book)
  • Analyze results, export metrics, spot a performance regression between runs, and run a load test in CI as a pipeline gate
  • Design a complete load test for a real API: smoke → load → stress, with thresholds, business-flow checks, and the CI pipeline

Before you start

What you need to bring

It's for you if...

  • Backend devs who need to know whether their API holds up under real traffic before a user in production finds out first
  • Teams that want performance thresholds (SLOs) that block a deploy automatically, not just get eyeballed after the fact
  • Devs who confuse "worked on my machine" with "holds up under concurrent load," and want to measure instead of guess
  • Teams evaluating k6 as their load-testing tool who want to understand its model before wiring it into CI

Requirements and materials

  • Basic HTTP knowledge (methods, status codes, JSON) and familiarity with a simple REST API
  • Python 3.14 installed locally (the load generator uses `threading`/`concurrent.futures`/`statistics` from the standard library)
  • No need to have k6 installed — the guide treats it as content; it can optionally be installed to run the real scripts

Content

The syllabus, module by module

Open any of them to see its lessons.

Common questions

What people usually ask

Start whenever you like

Reviews

What students say

These reviews are from enrolled students who completed at least 50% of the course. We moderate reviews only on content grounds (spam, offensive language, personal data), never for being critical or negative.

No approved reviews yet.

Be the first to share your experience!