k6

A modern load testing tool, using Go and JavaScript

"like unit testing, for performance"

k6 is a modern load testing tool, building on Load Impact's years of experience. It provides a clean, approachable JavaScript scripting API, distributed and cloud execution, and orchestration via a REST API.

Get Started    Guides

What is k6?

k6 is a free and open-source load testing tool built for making performance testing a productive and enjoyable experience.

Performance testing catches performance regressions and problems earlier. It will help you to build resilient systems and robust applications.

Key features:

  • CLI tool with developer-friendly APIs.
  • Load-Test-As-Code with scripting in JavaScript.
  • Easy automation and powerful performance Thresholds (like assertions).

It will enable you to write and maintain better performance tests.

Who uses k6

k6 users are typically Developers, QA Engineers, and DevOps. They use k6 for testing the performance of APIs, microservices, and websites.

The common k6 use cases are:

Load Testing

k6 is optimized for minimal consumption of system resources. It’s a high-performance tool designed for running tests with high load.

You can use it for running tests with a high load (spike, stress, endurance tests) in pre-production and QA environments.

Performance monitoring

k6 provides great primitives for code modularization, performance thresholds, and automation.

These features make it an excellent choice for performance monitoring.

You could run tests with a small amount of load to continuously monitor the performance of your production environment.

k6 does not

k6 is a high-performing load testing tool, scriptable in JavaScript. The architectural design to have these capabilities brings some trade-offs:

k6 does not run a browser

As with the majority of the load testing tools, k6 does not run a browser engine. It won’t render a webpage as a browser does, and will fail when using JavaScript libraries relying on browser APIs.

Running a browser engine would dramatically increase the consumption of system resources, and it will prevent the tool to be a good choice for load testing.

While k6 doesn’t run a browser, it can be used for website load testing. To help you testing websites and web apps, it can auto-generate a test script from a website session. Check out the Session recording / HAR support guide.

k6 does not run in Node.js

k6 does not run in Node.js because it would perform poorly while running larger tests.
Javascript is not generally well suited for high performance.

It's a Go program - to achieve maximum performance - embedding a JavaScript runtime for running tests written in JavaScript.

If you want to import npm modules or libraries using NodeJS APIs, you can bundle npm modules with browserify or webpack and import them in your tests. Read more about npm Modules.

Features

Integrations

There is also a bunch of Integrations to extend the behavior of k6.

Welcome


Suggested Edits are limited on API Reference Pages

You can only suggest edits to Markdown body content, but not to the API spec.