K6¶
A user profile running a K6 Virtual User has three panels of its own, Script, HTTP and Network, next to Name, Policies and Memory. Each setting maps to an option of k6 run, which the tooltip of the setting names.
Info
The load always comes from the user profile: its load policy replaces the scenarios, vus, duration, iterations and stages of the script options. The other script options still apply, the thresholds among them.
Script¶
- Entrypoint: the file
k6 runstarts from, the first script of the import by default. The other files of the Virtual User are shipped next to it, so its relative imports resolve. - Function: the exported function of the entrypoint this profile runs, the
execof a K6 scenario. Leave it empty to run the default export. Import Scenario fills it in from each K6 scenario, so one script can serve several user profiles. - Throw on request failure (
--throw): turns the warnings of K6 into errors that stop the iteration. A request that gets no response, a refused connection or a timeout for instance, then fails the iteration. A failedcheck()does not: it is counted, and the iteration goes on. - Ignore thresholds (
--no-thresholds): the thresholds of the script are not evaluated. - Abort on failed threshold: lets a threshold declaring
abortOnFailstop K6 on its load generator, while the other load generators go on, like the Stop Test error policy of a JMeter profile. Off by default: OctoPerf clears theabortOnFailof the thresholds, which are still evaluated and shown in the report, and the test runs its whole load. - Upload raw CSV output (
--out csv): in a standard test, the load generators uploadk6.csv, the raw K6 output with one line per measured value, with the test logs, for processing outside OctoPerf. Off by default.
Environment¶
The key/value pairs passed to k6 run as -e KEY=value. The script reads them as __ENV.KEY, like the constants and secrets of the project; a key set here wins over a project variable of the same name.
Stop¶
Override graceful stop sets how long a running iteration may finish once the load profile ends, the gracefulStop of a K6 scenario.
- Off, the default: the test ends with its load profile, and the iterations still running are interrupted. K6 would otherwise grant them 30 seconds.
- On: the running iterations get the duration set here to finish.
HTTP¶
Connections
- Skip TLS verification (
--insecure-skip-tls-verify): accept self-signed or otherwise invalid TLS certificates. - No connection reuse (
--no-connection-reuse): open a new connection for every request. - Max redirects (
--max-redirects): the redirects followed before a request fails, 10 by default. - User agent (
--user-agent): sent with every request instead of the K6 default.
Throughput
- Limit requests per second (
--rps): cap the requests per second of the virtual users. Each load generator runs its own K6 process, so the cap applies to each load generator of the profile. - Batch (
--batch): the parallel requests of onehttp.batch()call, 20 by default. - Batch per host (
--batch-per-host): the parallel requests of onehttp.batch()call towards the same host, 6 by default, 0 to lift the limit.
Network¶
DNS (--dns)
- Cache TTL: how long a resolved address is cached, a K6 duration such as
5m,0to never cache,infto cache forever. - Selection: which address is used when a hostname resolves to several, First, Random or Round robin.
- Policy: which IP families a hostname resolves to, Prefer IPv4, Prefer IPv6, Only IPv4, Only IPv6 or Any.
Blocked hostnames (--block-hostnames): the hostnames K6 refuses to call. *.example.com blocks every sub-domain.
Blocked IP ranges (--blacklist-ip): the IP ranges K6 refuses to call, in CIDR notation.
Tip
Blocking the hostnames of third-party services (analytics, advertising, CDN) keeps them out of the load test without editing the script.
Memory¶
The Memory panel of a K6 profile sets the memory reserved per virtual user, 6 MB by default, and the K6 capture budget. In a standard test, the load generator holds the HTTP exchanges of the virtual users while it matches them with their metrics, so that the details of a failed request can be shown in the report. Override capture share changes the share of the container those captures may take; the load generator keeps it within the bounds of the platform.



