> OctoPerf load testing - K6 settings documentation page. How to configure the script, HTTP and network options of a K6 User Profile.

Source: https://api.octoperf.com/doc/runtime/edit-scenario/edit-user-profile/options/k6/

# K6

A user profile running a [K6 Virtual User](https://api.octoperf.com/doc/design/create-virtual-user/import-k6-scripts/) has three panels of its own, **Script**, **HTTP** and **Network**, next to **Name**, [Policies](https://api.octoperf.com/doc/runtime/edit-scenario/edit-user-profile/options/policies/) and [Memory](https://api.octoperf.com/doc/runtime/edit-scenario/edit-user-profile/options/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

![K6 Script settings](https://api.octoperf.com/doc/runtime/edit-scenario/edit-user-profile/img/user-profile-k6-script.png "K6 Script settings")

- **Entrypoint**: the file `k6 run` starts 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 `exec` of a K6 scenario. Leave it empty to run the default export. [Import Scenario](https://api.octoperf.com/doc/design/create-virtual-user/import-k6-scripts/#import-the-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 failed `check()` 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 `abortOnFail` stop K6 on its load generator, while the other load generators go on, like the **Stop Test** [error policy](https://api.octoperf.com/doc/runtime/edit-scenario/edit-user-profile/options/policies/#error-handling) of a JMeter profile. Off by default: OctoPerf clears the `abortOnFail` of 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 upload `k6.csv`, the raw K6 output with one line per measured value, with the [test logs](https://api.octoperf.com/doc/analysis/edit-bench-report/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

![K6 HTTP settings](https://api.octoperf.com/doc/runtime/edit-scenario/edit-user-profile/img/user-profile-k6-http.png "K6 HTTP settings")

**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 one `http.batch()` call, 20 by default.
- **Batch per host** (`--batch-per-host`): the parallel requests of one `http.batch()` call towards the same host, 6 by default, 0 to lift the limit.

## Network

![K6 Network settings](https://api.octoperf.com/doc/runtime/edit-scenario/edit-user-profile/img/user-profile-k6-network.png "K6 Network settings")

**DNS** (`--dns`)

- **Cache TTL**: how long a resolved address is cached, a K6 duration such as `5m`, `0` to never cache, `inf` to 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

![K6 Memory settings](https://api.octoperf.com/doc/runtime/edit-scenario/edit-user-profile/img/user-profile-k6-memory.png "K6 Memory settings")

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.
