Real-Time k6 Interview Questions on Test Results (2027)

40 real-time k6 interview questions on reading results: summary metrics, thresholds, exit codes, dropped_iterations, handleSummary and k6 v2.

Sep 27, 2025 - 16:25
Nov 8, 2026 - 13:25
 0  73
Real-Time k6 Interview Questions on Test Results (2027)

Real-time k6 interview questions hand you a test run, a summary or a failing CI job and ask what it means: why p(95) is high, why checks failed but the build passed, what dropped_iterations says, which metric shows connection trouble, and how to make thresholds stop a bad run. Strong answers read the numbers, name the k6 metric or option involved and say what you would change.

This page has 40 questions focused on running k6 and interpreting its output, checked against the Grafana k6 documentation in November 2026 (the docs list k6 v2.3.0 as the latest release). It is the keeper page for real-time k6 practice. For writing test scripts from scratch, see the 65+ k6 interview questions; for design-style stories, see the scenario-based k6 questions.

Key takeaways

  • http_req_duration is sending + waiting + receiving. It excludes DNS lookup and connection time, which show up in http_req_blocked, http_req_connecting and http_req_tls_handshaking.
  • Checks never change the exit code on their own. A threshold such as checks: ['rate>0.99'] makes them fail the run.
  • When any threshold fails, k6 exits with a non-zero code, which is what fails a CI job.
  • k6 v2.0.0 removed --no-summary (use --summary-mode=disabled), the legacy summary mode and the externally-controlled executor. Old scripts and CI lines may break.
  • dropped_iterations means k6 could not start iterations as planned, usually because an arrival-rate scenario ran out of VUs.

Built-in metrics you must be able to read

MetricTypeWhat a high value suggests
http_req_durationTrendSlow server processing or large responses
http_req_waitingTrendTime to first byte: backend slowness
http_req_blockedTrendWaiting for a free connection slot
http_req_connectingTrendSlow TCP connects, network or load balancer issues
http_req_tls_handshakingTrendTLS cost, often from no connection reuse
http_req_receivingTrendLarge payloads or bandwidth limits
http_req_failedRateShare of requests counted as failed
dropped_iterationsCounterNot enough VUs or maxDuration reached
iteration_durationTrendWhole user journey time, including sleeps

Freshers: reading a k6 run (1-14)

1. What does the end-of-test summary show by default?

In the default compact mode it shows threshold results, check results and aggregated metrics grouped by category. --summary-mode=full adds results per group and per scenario, and --summary-mode=disabled turns the summary off.

2. Which statistics does k6 show for trend metrics?

The default for summaryTrendStats is avg, min, med, max, p(90), p(95). Add p(99) with --summary-trend-stats="avg,med,p(95),p(99),max" when your SLO uses the 99th percentile.

3. What is the difference between avg and p(95) in the summary?

The average mixes fast and slow requests and hides the tail. p(95) means 95% of requests were faster than that value. Users feel the tail, so SLOs and thresholds usually use percentiles.

4. What does http_req_duration include?

The documentation defines it as http_req_sending + http_req_waiting + http_req_receiving. It leaves out DNS lookup and connection setup, so a slow handshake does not show up here.

5. What is http_req_waiting?

The time spent waiting for the first byte of the response after sending the request (time to first byte). If waiting makes up most of the duration, the backend is slow, not the network.

6. What does http_req_failed measure?

The rate of requests k6 considers failed. By default, status codes from 200 to 399 are treated as expected and anything else counts as a failure, and you can change what counts as expected with http.setResponseCallback.

7. Checks failed in the summary, but the CI job passed. Why?

Checks record pass or fail but do not affect the exit status. Add a threshold on the checks metric so failures make k6 exit non-zero.

export const options = {
  thresholds: {
    checks: ['rate>0.99'],
    http_req_failed: ['rate<0.01'],
    http_req_duration: ['p(95)<400'],
  },
};

8. What does a threshold line in the summary tell you?

Each threshold shows whether it passed or failed and the observed value. If any threshold fails, the test is marked failed and k6 exits with a non-zero code. When all pass, the exit code is 0.

9. What are vus and vus_max?

vus is a gauge of currently active virtual users. vus_max is the maximum number of VUs k6 has allocated. If vus reaches vus_max during an arrival-rate test, k6 may start dropping iterations.

10. What does iterations tell you?

The total number of times VUs completed the default function (or scenario function). Divide by duration to get iterations per second and compare it with the rate you planned.

11. Why is iteration_duration much higher than http_req_duration?

An iteration contains several requests plus sleep() calls and script logic. iteration_duration covers all of it, so it is expected to be larger.

12. How do you print response details for one failing request?

Run with --http-debug (headers) or --http-debug="full" (headers and bodies) on a small run, or log selected fields with console.log inside an if on the status code. Avoid full debug on big tests because the output is huge.

13. How do you save raw results for later analysis?

Use an output. The docs list file outputs (JSON and CSV) and streaming outputs such as Prometheus remote write, InfluxDB, OpenTelemetry, StatsD and Grafana Cloud k6.

k6 run --out json=results.json script.js
k6 run --out csv=results.csv script.js

14. How do you turn the summary off in k6 v2?

Use --summary-mode=disabled. The v2.0.0 release notes removed the old --no-summary flag, so a CI line that still uses it will fail.

2-5 years: diagnosing results (15-30)

15. http_req_blocked has a high p(95). What does it mean?

Requests waited for a free TCP connection slot before starting. Common causes are many parallel requests per host (the batchPerHost default is 6 for http.batch), connection reuse turned off, or the client machine running short of sockets.

16. http_req_tls_handshaking is high on every request. What do you check?

Check whether noConnectionReuse is set to true (default false) or the server closes connections after each response, so every request pays for a new handshake. Fix connection reuse or keep-alive and run again.

17. What does a large dropped_iterations count mean?

For arrival-rate executors, k6 could not start iterations at the planned rate because no VU was free. For iteration-based executors, maxDuration expired first. Raise maxVUs or preAllocatedVUs, or investigate why responses got slow enough to tie up every VU.

18. Throughput was lower than the target, but no threshold failed. How do you spot it?

Compare http_reqs per second and iterations with the plan and look for dropped_iterations. Add a threshold such as dropped_iterations: ['count<100'] so an under-delivered load test fails instead of passing silently.

19. How do you stop a test early when the system is clearly broken?

Use the long threshold form with abortOnFail, and delayAbortEval so a few slow warm-up requests do not end the test.

thresholds: {
  http_req_failed: [{ threshold: 'rate<0.05', abortOnFail: true, delayAbortEval: '30s' }],
}

In Grafana Cloud k6, thresholds are evaluated every 60 seconds, so an abort can take up to a minute.

20. How do you see results for one endpoint when the summary mixes everything?

Tag requests (for example tags: { name: 'checkout' }) and add a threshold on the tagged sub-metric, such as 'http_req_duration{name:checkout}': ['p(95)<600']. Sub-metrics with thresholds appear in the summary on their own line.

21. How do you write a custom report file at the end of a run?

Export handleSummary(data) and return an object whose keys are stdout, stderr or file paths. Defining it replaces the default summary, so return textSummary under stdout if you still want console output.

import { textSummary } from 'https://jslib.k6.io/k6-summary/0.0.2/index.js';

export function handleSummary(data) {
  return {
    stdout: textSummary(data, { indent: ' ', enableColors: true }),
    'summary.json': JSON.stringify(data),
  };
}

22. Errors appear as warnings in the log but the script keeps going. Why?

The throw option defaults to false, so some errors, such as failed requests, are logged as warnings instead of throwing exceptions. Set --throw (or -w) when you want the iteration to stop on those errors during debugging.

23. The run uses a lot of memory on the load generator. What can you change?

Set discardResponseBodies: true (default false) when you do not need bodies, and enable bodies only for requests you check with responseType. Also check for large arrays built per VU; load shared test data once with SharedArray.

24. setup() times out before the test starts. What is the limit?

setupTimeout and teardownTimeout both default to 60 seconds. Raise them if setup must create many test accounts, or move that work into a separate data-preparation job. Grafana Cloud k6 caps setupTimeout at 10 minutes.

25. How do you tell whether slowness is on the server or the load generator?

Watch CPU and network on the machine running k6. If k6 is near 100% CPU, results include client-side delay. Compare http_req_waiting with server-side latency from your APM: if the server reports fast responses but k6 sees slow ones, the bottleneck is in between or on the client.

26. How do you stream live results into dashboards during a run?

Use a streaming output, for example Prometheus remote write or InfluxDB, and view the metrics in Grafana while the test runs. This lets you correlate k6 latency with backend CPU, database and error graphs on the same time axis.

27. How do you compare two runs fairly?

Keep the same script, data, executor settings, environment and load generator location; save each run's summary JSON with handleSummary; and compare the same percentiles. Change one thing at a time.

28. Which executor would you use to hold a fixed request rate, and why does it matter for results?

constant-arrival-rate starts iterations at a fixed rate regardless of response time, so slow responses show up as rising latency and dropped iterations rather than lower throughput. constant-vus lets throughput fall as the system slows, which can hide problems.

29. A script that worked last year now fails to start with an executor error. What changed?

k6 v2.0.0 removed the externally-controlled executor, and scripts that use it fail to start. Switch to ramping-vus, constant-vus or constant-arrival-rate. The remaining executors are shared-iterations, per-vu-iterations, constant-vus, ramping-vus, constant-arrival-rate and ramping-arrival-rate.

30. A CI step using k6 login stopped working after an upgrade. Why?

The v2.0.0 release notes removed k6 login; use k6 cloud login, which now needs both a token and a stack. k6 cloud script.js also became k6 cloud run script.js.

Senior: results in pipelines and decisions (31-35)

31. How do you gate a release on k6 results?

Run a short smoke and load test in the pipeline with thresholds that match the service SLOs (latency percentile, error rate, check rate, dropped iterations). The non-zero exit code on failure stops the pipeline. Save the summary JSON as a build artifact for later comparison.

32. How do you choose threshold values?

Start from SLOs and a baseline run of the current version, not guesses. Set thresholds slightly looser than the baseline to avoid noise, tighten them as the service improves, and separate critical endpoints with tagged thresholds.

33. Thresholds fail randomly in CI. How do you make them stable?

Use a dedicated load generator and environment, add a warm-up stage and delayAbortEval, run long enough for percentiles to settle, and avoid sharing the test environment with other jobs. Treat repeated flakiness as a signal that the environment or the threshold is wrong.

34. How do you report results to non-engineers?

Give the pass or fail against each SLO, the tested load (requests per second and duration), the p(95) and error rate compared with the previous release, and one graph over time. Link the raw summary for engineers.

35. Cloud runs used to exit 0 when aborted. What changed?

The v2.0.0 notes say cloud runs that abort for reasons other than a threshold now exit with code 97 instead of 0. Pipelines that assumed success on abort will start failing, which is the intended behaviour.

Live result-reading tasks (36-40)

36. p(95) latency is 2.1 s; http_req_waiting p(95) is 2.0 s. Where is the problem?

Almost all the time is waiting for the first byte, so the server or something behind it (database, downstream API) is slow. Network and payload size are not the main cause.

37. http_req_failed is 0% but checks are at 70%. What is going on?

Responses returned expected status codes, but the content was wrong, for example an error message inside a 200 response or an empty list. The checks caught a functional failure that status codes missed. Add a checks threshold so this fails the run.

38. Latency is fine, but dropped_iterations is 4,000 in a 10-minute arrival-rate test. What do you conclude?

The test did not deliver the planned load because k6 ran out of VUs, so the good latency numbers describe a lighter test than intended. Raise preAllocatedVUs and maxVUs, check load generator capacity and rerun before drawing conclusions.

39. The first minute shows very high http_req_connecting and then it drops. Is that a problem?

Usually it is warm-up: new connections and TLS sessions at start-up, maybe autoscaling. Add a ramp-up stage, use delayAbortEval, and judge thresholds over the steady-state period. If it never settles, look at the load balancer or connection limits.

40. The k6 job passes locally but fails in CI with the same script. What do you check?

Different k6 versions (flags removed in v2), different environment variables or base URLs, network distance from the runner to the target, and a smaller CI machine that limits VUs. Print k6 version in the job and pin the version you test with.

Related pages

Beginners should start with the k6 load testing questions for beginners, and engineers aiming for performance roles can use the k6 engineer interview questions. Performance testing sits inside CI/CD and observability work, which our DevOps training covers alongside Prometheus and Grafana training, in Kharadi, Pune and live online.

FAQ

Why did my k6 test pass when checks failed?

Checks do not affect the exit code. Add a threshold on the checks metric, such as rate>0.99, so failed checks fail the run.

What exit code does k6 return when a threshold fails?

A non-zero exit code. When all thresholds pass, k6 exits with 0, so CI tools can use the exit status directly.

What does http_req_duration include?

Sending, waiting and receiving time. It excludes DNS lookup and connection setup, which appear in other metrics.

What does dropped_iterations mean?

k6 could not start iterations as planned, usually because an arrival-rate scenario had no free VUs, or because maxDuration expired.

How do I disable the summary in k6 v2?

Use --summary-mode=disabled. The --no-summary flag was removed in k6 v2.0.0.

Does handleSummary replace the default summary?

Yes. Return textSummary under stdout if you want to keep the console summary as well.

Which statistics does k6 show for trend metrics by default?

avg, min, med, max, p(90) and p(95). Change them with --summary-trend-stats.

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.