RousselTMLEARNING

Article · Grafana k6: load and performance testing

Why load test?

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.

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

My progress

  • ⏱ Estimated time : ≈ 3 min

Sign in to track your progress and take notes. Sign in

💬 Questions about this lesson

No questions yet: be the first to ask for help or share your configuration.

Ask a question about this lesson →

Recommended Articles

Performance testing best practices with k6

Checklist for useful load tests: objectives, realistic scenarios, environment, thresholds, observ...

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 ...

Browser testing and synthetic monitoring with k6

Test a web application in a real browser with the k6 browser module, measure Core Web Vitals, and...

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_faile...

End-to-end CI/CD (2/5): continuous integration, testing and quality

Succeed with continuous integration: the test pyramid, unit, integration, contract and end-to-end...

Website monitoring: availability, HTTPS monitoring, certificates and performance

Set up website monitoring: availability and HTTPS checks, certificate expiry, response time, Core...

k6 in continuous integration and on Kubernetes (k6-operator)

Automate performance tests: k6 in GitHub Actions and GitLab CI with blocking thresholds, distribu...

HAProxy in Kubernetes: the high-performance Ingress Controller

Discover in depth how HAProxy integrates with Kubernetes: direct-to-pod architecture, hot update ...

End-to-end CI/CD (4/5): deployment strategies and rollback

Deploy without downtime and without risk: recreate, rolling update, blue/green, canary, feature f...

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!