Skip to main content
k6

Like unit testing, for performance

k6 is a modern load-testing tool built on years of experience in the performance and testing industries. It’s designed to be powerful, extensible, and full-featured with the best developer experience at its core.
Don’t want to write code? Meet k6 Studio, a desktop application that helps you generate k6 scripts without touching code!

What is k6?

k6 is an open-source load testing tool that makes performance testing easy and productive for engineering teams. Built for the DevOps era, k6 enables you to write tests as code, integrate them into your CI/CD pipelines, and scale from local development to distributed cloud execution.

Core philosophy

This is what load testing looks like in the 21st century:
  • Tests as code: Reuse scripts, modularize logic, version control, and integrate tests with your CI
  • Developer-first: Familiar JavaScript syntax with the performance of Go under the hood
  • Production-ready: Simulate real-world traffic patterns with flexible load generation
  • Cloud-native: Native integration with Grafana Cloud and flexible metrics export

Key features

Configurable load generation

Even lower-end machines can simulate lots of traffic with k6’s efficient architecture.

Tests as code

Write tests in JavaScript, version control them, and integrate seamlessly with your CI/CD pipeline.

Full-featured API

Rich scripting API packed with features to simulate real application traffic patterns.

Embedded JavaScript engine

Get the performance of Go with the scripting familiarity of JavaScript.

Multiple protocol support

HTTP, WebSockets, gRPC, Browser automation, and more out of the box.

Large extension ecosystem

Extend k6 to support your needs with a rich ecosystem of community extensions.

Flexible metrics

Export summary statistics or granular metrics to the service of your choice.

Grafana Cloud integration

Native SaaS solution for test execution, metrics correlation, and data analysis.

Example test script

Here’s what a k6 test looks like:
import http from "k6/http";
import { check, sleep } from "k6";

// Test configuration
export const options = {
  thresholds: {
    // Assert that 99% of requests finish within 3000ms.
    http_req_duration: ["p(99) < 3000"],
  },
  // Ramp the number of virtual users up and down
  stages: [
    { duration: "30s", target: 15 },
    { duration: "1m", target: 15 },
    { duration: "20s", target: 0 },
  ],
};

// Simulated user behavior
export default function () {
  let res = http.get("https://quickpizza.grafana.com");
  // Validate response status
  check(res, { "status was 200": (r) => r.status == 200 });
  sleep(1);
}
You can run scripts like this on the CLI, in your CI, or across a Kubernetes cluster.

Use cases

k6 is perfect for:
  • Load testing: Verify your system can handle expected traffic
  • Stress testing: Find your system’s breaking point
  • Spike testing: Test how your system handles sudden traffic spikes
  • Soak testing: Validate reliability over extended periods
  • API testing: Functional and performance testing of REST APIs
  • Browser testing: End-to-end testing with real browser automation

Why choose k6?

Developer experience

Write tests in familiar JavaScript, use modern ES6+ features, and enjoy excellent documentation and tooling.

CI/CD integration

Designed from the ground up to fit seamlessly into your continuous integration and deployment pipelines.

Scalability

Run tests from your laptop or scale to millions of requests across distributed infrastructure.

Open source

AGPL-3.0 licensed with an active community and transparent development on GitHub.

Next steps

Install k6

Get k6 installed on your platform in minutes

Quick start guide

Run your first load test in under 5 minutes
k6 is distributed under the AGPL-3.0 license. Make sure you understand the license terms before using k6 in your projects.

Build docs developers (and LLMs) love