RousselTMLEARNING

DevOps

Load testing with Grafana k6: why, and which types of tests

Why test performance before production, the types of tests (smoke, load, stress, spike, soak, breakpoint) and the strengths of Grafana k6.

1. Why load test? #

Finding the limits before users do.

The questions a test answers #

Available in: ✓ OSS ✓ Enterprise ✓ Cloud k6 open source; managed runs with Grafana Cloud k6

  • Does the service handle the expected traffic with the promised latency (SLO)?
  • Where is the breaking point, and how does the service break (slowly, abruptly)?
  • Is a new version slower than the previous one?
  • Does autoscaling react fast enough?
Good to know: A load test is only valuable if it is observed: metrics, traces and profiles of the system under test explain what the test measures. That is why this course connects k6 to Prometheus and Grafana.

2. Types of tests #

One script base, several load profiles.

Overview #

Types of tests
Indicative orders of magnitude, to adapt to real traffic.
TypeGoalTypical duration
SmokeCheck that the script and the service work (1 to 5 users)1 min
Average loadValidate behavior under normal traffic15 to 60 min
StressObserve behavior beyond normal traffic15 to 60 min
SpikeAbsorb a sudden surge (sales, announcement)A few minutes
SoakDetect memory leaks and slow degradationsSeveral hours
BreakpointFind the maximum capacityUntil it breaks

3. Why k6? #

A tool designed for developers.

Strengths #

FeatureDetail
Scripts in JavaScript / TypeScriptVersioned with the code, reviewed in pull requests
Go engineThousands of virtual users on a single machine
ThresholdsThe test fails automatically if an objective is not met: ideal in CI
Multiple outputsPrometheus, OpenTelemetry, JSON, CSV, Grafana Cloud
ProtocolsHTTP, WebSocket, gRPC, real browser (browser module) and extensions (Kafka, SQL...)
# Installation
brew install k6                                  # macOS
sudo apt install k6                              # Debian/Ubuntu (dépôt k6)
docker run --rm -i grafana/k6 run - < script.js  # sans installation
Good to know: k6 is open source (AGPLv3), maintained by Grafana Labs. Version 1.0, released in 2025, stabilized the API and brought native TypeScript support.

Related articles

Writing k6 scripts: requests, checks, scenarios and executors

The structure of a k6 script (init, setup, default, teardown), HTTP requests, checks, groups and tags, and mo…

Thresholds, metrics and results of a k6 test

Read the summary of a k6 test, understand the built-in metrics (http_req_duration, http_req_failed, iteration…

Observing a k6 test: Prometheus, Grafana and correlation with the system under test

Send k6 results to Prometheus (remote write) or via OpenTelemetry, visualize them in Grafana and correlate th…

Keep learning

Support us

♥ SUPPORT US

Support RousselTM Learning

Courses, articles, labs and certificates stay free with no intrusive ads. A voluntary contribution, of any amount you choose, pays for hosting, lab environments and new content.

Contribute with PayPal Any amount · card or PayPal accountLearn more
QR code PayPal
Or scan this QR code with your phone

Thank you, every contribution counts!