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.
- CLI tool with developer-friendly APIs.
- Easy automation and powerful performance Thresholds (Pass/Fail criteria).
k6 will enable you to write and maintain better performance tests.
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:
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.
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 run a browser
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.
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.
- Scripting in ES6 JS: support for modules to aid code reusability across an organization.
- Everything as code: test logic and configuration options are both in JS for version control friendliness.
- CLI tool to run and control your tests from the command line.
- Assertions for goal-oriented load testing: Checks and Thresholds.
- Automation-friendly: easy to configure into CI/CD Pipelines.
- HTTP/1.1, HTTP/2 and WebSockets protocol support.
- Custom Metrics to collect your own metrics.
- Flexible execution control.
- TLS features: client certificates, configurable versions and ciphers
- And much more: Cookies, Crypto library, Environment variables, k6/encoding, file upload...
There is also a bunch of Integrations to extend the behavior of k6.
- Flexible metrics storage and visualization: InfluxDB + Grafana, JSON, DataDog, Apache Kafka and Load Impact.
- Cloud execution to scale and distribute globally your tests with the LoadImpact cloud service.
- HAR recorder: record browser sessions as .har files and directly convert them to k6 scripts.
- JMeter-to-k6 converter and Postman-to-k6 converter.
Updated 2 months ago