k6 FAQ Quick Reference for DevOps Interviews (2026)

k6 interview FAQs in plain terms: VUs, executors, checks vs thresholds, metrics, Prometheus output and CI use, updated for k6 v2 changes.

Sep 27, 2025 - 16:54
Nov 16, 2026 - 13:33
 0  48
k6 FAQ Quick Reference for DevOps Interviews (2026)

k6 interview FAQs centre on a few ideas: virtual users and iterations, executors, checks versus thresholds, metrics such as http_req_duration, and how to run k6 in CI so a slow build fails. This quick reference answers each in plain terms and reflects the k6 v2 line, which removed several older commands and the externally-controlled executor.

Use this page as the concept refresher. For a structured study plan use the k6 interview prep guide, and for beginner load testing questions see k6 load testing interview questions for beginners. If you want the full DevOps question bank, start from the 20 most common DevOps interview questions.

Key takeaways

  • k6 is Grafana Labs' open-source load testing tool. Tests are written in JavaScript and run by a Go binary.
  • The current major line is v2. The k6 GitHub releases page lists v2.4.0 as the latest release in November 2026.
  • k6 v2 removed k6 login, k6 pause, k6 resume, k6 scale, k6 status and the externally-controlled executor. Old blog examples that use them will fail.
  • Checks record pass or fail but never fail the test. Thresholds decide the exit code, which is what CI needs.
  • Six executors remain: shared-iterations, per-vu-iterations, constant-vus, ramping-vus, constant-arrival-rate and ramping-arrival-rate.

k6 concepts at a glance

TermPlain meaning
VU (virtual user)A concurrent loop that runs your default function again and again.
IterationOne complete run of the default function by one VU.
ScenarioA named workload in options.scenarios with its own executor and settings.
ExecutorThe rule that schedules VUs and iterations for a scenario.
CheckA boolean assertion on a response, counted in the checks metric.
ThresholdA pass/fail rule on a metric, such as p(95)<200; failing it fails the run.
OutputWhere metrics are streamed, for example JSON, CSV, Prometheus remote write or Grafana Cloud k6.

Basics

1. What is k6 used for?

k6 generates load against APIs, websites and services to measure response times, error rates and throughput under traffic. It is built for developers and DevOps engineers who want load tests in code, stored in Git and run in pipelines, rather than recorded in a GUI.

2. Why JavaScript if k6 is written in Go?

The engine is Go, which keeps resource use per virtual user low. Scripts are JavaScript so that test authors can use a language they already know. k6 is not Node.js, though: npm packages that depend on Node built-ins do not work, and k6 provides its own modules such as k6/http.

3. What does the smallest useful k6 script look like?

import http from 'k6/http';
import { check, sleep } from 'k6';

export const options = {
  vus: 10,
  duration: '1m',
  thresholds: {
    http_req_duration: ['p(95)<200'],
    http_req_failed: ['rate<0.01'],
  },
};

export default function () {
  const res = http.get('https://quickpizza.grafana.com/');
  check(res, { 'status is 200': (r) => r.status === 200 });
  sleep(1);
}

Run it with k6 run script.js. The sleep(1) adds think time so each VU behaves more like a person than a tight loop.

4. What is the difference between VUs and requests per second?

VUs are concurrency. Requests per second is the result of how many VUs you have and how long each iteration takes. If the system slows down, a fixed number of VUs sends fewer requests. If you need a fixed request rate regardless of response time, use an arrival-rate executor.

Executors and scenarios

5. Which executors does k6 have?

The k6 docs list six: shared-iterations (a fixed number of iterations shared across VUs), per-vu-iterations (each VU runs a set number), constant-vus (fixed VUs for a duration), ramping-vus (VUs change over stages), constant-arrival-rate (fixed iteration rate) and ramping-arrival-rate (iteration rate changes over stages).

6. What happened to the externally-controlled executor?

k6 v2.0.0 removed it, along with the pause, resume and scale commands that drove it. Scripts that still use it fail to start. If an interviewer asks how to change load during a run, the current answer is to design stages with ramping-vus or ramping-arrival-rate in advance.

7. Open model or closed model?

VU-based executors are a closed model: a VU waits for a response before starting its next iteration, so a slow system receives less load. Arrival-rate executors are an open model: new iterations start on schedule whether earlier ones finished or not, which is closer to real user traffic hitting a public site. Know both terms; they come up often.

8. Why would you define several scenarios in one test?

To model mixed traffic, such as many users browsing while a few users check out, each with its own executor, rate and function through the exec option. Scenarios can also start at different times with startTime.

export const options = {
  scenarios: {
    browse: {
      executor: 'constant-arrival-rate',
      rate: 50, timeUnit: '1s', duration: '5m',
      preAllocatedVUs: 50, maxVUs: 200,
      exec: 'browse',
    },
    checkout: {
      executor: 'ramping-vus',
      startVUs: 0,
      stages: [{ duration: '2m', target: 10 }, { duration: '3m', target: 10 }],
      exec: 'checkout',
    },
  },
};

Checks, thresholds and metrics

9. Check or threshold: which fails the build?

Thresholds. The k6 docs say checks do not affect the exit status, so a test with only checks cannot fail on them. If you want failed checks to fail the run, add a threshold on the checks metric, for example checks: ['rate>0.9'].

10. What happens when a threshold fails?

The run finishes with a failed status and k6 exits with a non-zero code, which makes the CI job fail. Failed thresholds are marked with a cross in the summary. To stop the test early on failure, use the long form with abortOnFail: true, and delayAbortEval to wait for enough samples first.

11. Which built-in HTTP metrics matter most?

http_req_duration (time spent sending, waiting and receiving, without DNS lookup or connection setup), http_req_failed (rate of failed requests), http_reqs (count) and iteration_duration. Interviewers like to ask why you would put thresholds on percentiles such as p(95) rather than the average: averages hide slow tails.

12. What metric types exist for custom metrics?

Counter, Gauge, Rate and Trend, imported from k6/metrics. A Trend is the one to use for custom timings, because it supports percentiles in thresholds.

13. What are tags and groups for?

Tags label metrics so you can filter or set thresholds per endpoint, for example http_req_duration{name:login}. Groups wrap steps of a user journey and produce a group duration. Use tags for filtering and groups for readable structure.

Results and observability

14. Where can k6 send results?

To files (JSON, CSV), to Grafana Cloud k6, and to third-party systems including Prometheus remote write, InfluxDB, Datadog, Elasticsearch, Kafka, New Relic, CloudWatch and OpenTelemetry, as listed in the k6 real-time output docs.

15. How do you send k6 metrics to Prometheus?

Use the Prometheus remote write output with -o experimental-prometheus-rw and set K6_PROMETHEUS_RW_SERVER_URL. By default it sends p(99) for trend metrics; set K6_PROMETHEUS_RW_TREND_STATS to add p(95), min or max. Then build dashboards in Grafana. Our guide to Prometheus and Grafana together shows the dashboard side.

K6_PROMETHEUS_RW_SERVER_URL=http://localhost:9090/api/v1/write \
K6_PROMETHEUS_RW_TREND_STATS="p(95),p(99),max" \
k6 run -o experimental-prometheus-rw script.js

16. Is there a built-in dashboard?

Yes. The k6 v2.0.0 release notes describe a built-in web dashboard you start with k6 run --out=web-dashboard. It is handy for watching a local run without setting up Grafana.

CI/CD and operations

17. How do you add k6 to a CI pipeline?

Run k6 run in a job after the application is deployed to a test environment, with thresholds that reflect your service level objectives. Because a failed threshold returns a non-zero exit code, the pipeline stops without extra scripting. Keep the CI test short, a smoke or small load test, and schedule longer soak tests separately.

18. What changed for k6 cloud commands in v2?

Use k6 cloud run script.js; the old k6 cloud script.js form was removed. k6 login was removed too, and every k6 cloud command now needs a Grafana Cloud stack, set with k6 cloud login, K6_CLOUD_STACK_ID or the stackID option. Cloud runs that abort for reasons other than thresholds now exit with code 97.

19. Where should the load generator run?

Not on the same machine as the system under test, and not on a tiny CI runner if you need high load, because the generator itself becomes the bottleneck. Watch the load generator's CPU and network during the test.

20. What are k6 extensions?

Extensions add protocols or outputs in Go, built into a custom binary with xk6. In v2, the Redis module moved from k6/experimental/redis to the extension k6/x/redis, which is a good detail to know if your old scripts used it.

Test types

21. Name the common load test types.

Smoke (minimal load to prove the script works), average load, stress (above normal load), spike (sudden jump), soak (long duration to find leaks) and breakpoint (increase until something fails). Each is just a different executor shape and duration in k6.

22. How do you stop a test from hurting production?

Run against a test environment sized like production where possible. If you must test production, agree a window, start with a smoke test, use abortOnFail thresholds on error rate, and have someone watching the service dashboards ready to stop the run.

23. What does a smoke test look like in k6?

A smoke test uses one or two VUs for a short time, often under a minute, with the same thresholds as the real test. Its only job is to prove the script works and the target responds before you spend time on a large run. Many teams run a smoke test on every merge and the heavier tests on a schedule.

24. How is k6 different from JMeter?

JMeter is a Java application where test plans are usually built in a GUI and saved as XML files. k6 tests are JavaScript files run from the command line, which makes them easier to review in pull requests and to run in CI. JMeter has a large plugin ecosystem and many protocols; k6 covers common web protocols in core and adds others through extensions. In an interview, focus on fit: code-first teams usually prefer k6, while teams with existing JMeter plans may keep them.

25. How do you read the end-of-test summary?

Start with the thresholds section: every threshold shows a tick or a cross. Then look at http_req_failed for the error rate, the p(95) and p(99) of http_req_duration for latency, and iterations and http_reqs for throughput. Compare those numbers against the previous run of the same test, not against a guess. A single run tells you little; trends across runs tell you whether a change made things slower.

26. What is a realistic first performance target?

Take it from your service level objectives, not from a round number. If the team has agreed that 95% of checkout requests should finish within a set time, encode that exact rule as a threshold on a tagged metric. If there is no objective yet, run a baseline test, record the current p(95) and error rate, and set thresholds slightly above them so the test catches regressions. Revisit the numbers once product owners agree on real objectives.

27. When does setup() run and what is it for?

Once, before VUs start. It is the place for one-off work such as fetching an auth token or creating test records, and it may make HTTP requests, unlike init code. Whatever it returns is passed to the default function and to teardown(). The default setup timeout is 60 seconds. The k6 scripting interview questions post covers the lifecycle in detail.

28. How do you load a large list of test users without running out of memory?

Wrap the data in a SharedArray from k6/data, created in init code. Its loading function runs once and the data is shared across VUs instead of copied into each one. It is read-only, so it holds input data, not state that VUs change during the test.

29. How do you stop k6 from flooding a dashboard with one series per URL?

Give requests with dynamic paths a stable name tag, such as GetOrder, so /orders/1 and /orders/2 report as one series. This matters most when you stream to Prometheus, where each unique tag value becomes a new time series. It also makes per-endpoint thresholds possible, because you can filter on that tag.

30. What exit code does a Grafana Cloud k6 run return when it aborts?

The k6 v2.0.0 release notes say threshold aborts return 99, and cloud runs that abort for other reasons now return 97 instead of 0. CI scripts that only checked for zero will still catch both, but if your pipeline treated other codes specially, update it.

Where to go next

Once these answers feel easy, practise reading test output with the real-time k6 results questions and try designing workloads with the scenario-based k6 questions. Write each script yourself and run it against a demo application such as Grafana's QuickPizza, which the k6 learning materials use, before the interview.

Performance testing in pipelines is covered in our DevOps training, offered at the Kharadi, Pune classroom and live online.

FAQ

Is k6 free?

The k6 tool is open source and free to run locally. Grafana Cloud k6 is a separate hosted service with its own plans.

Is there an official k6 certification?

We found none from Grafana Labs. Treat k6 preparation as interview prep and show working scripts in a repository.

Does k6 support browser testing?

Yes, through the k6 browser module, which drives a real browser and reports web vitals. In v2 the old FID metric was replaced by browser_web_vital_inp.

What is the difference between checks and thresholds in k6?

Checks are assertions that are counted but never fail the run. Thresholds are pass/fail rules on metrics that set the exit code.

Which executor gives a fixed requests-per-second load?

constant-arrival-rate, because it starts iterations at a fixed rate regardless of response time.

Can I still use k6 pause and k6 scale?

No. Both were removed in k6 v2.0.0 together with the externally-controlled executor.

References

What's Your Reaction?

Like Like 0
Dislike Dislike 0
Love Love 0
Funny Funny 0
Angry Angry 0
Sad Sad 0
Wow Wow 0
Mridul I am a passionate technology enthusiast with a strong focus on DevOps, Cloud Computing, and Cybersecurity. Through my blogs at DevOps Training Institute, I aim to simplify complex concepts and share practical insights for learners and professionals. My goal is to empower readers with knowledge, hands-on tips, and industry best practices to stay ahead in the ever-evolving world of DevOps.