Options reference
Options configure test-run behavior. Use options to define test tags, thresholds, user agents, the number of virtual users and iterations, and much more.How to use options
You can set options in multiple places with different levels of precedence:Order of precedence
When you set options in multiple places, k6 applies them in this order (highest to lowest precedence):- Command-line flags
- Environment variables
- Script options
- Default values
Common options
Virtual users and duration
Number of virtual users to run concurrently.
Total test duration. The test will run for this duration with the specified number of VUs.
Total number of iterations to execute across all VUs.
Stages
Ramp VUs up or down during the test.
Thresholds
Pass/fail criteria for metrics.
Scenarios
Advanced configuration for VU and iteration scheduling.
Complete options list
Here’s the complete list of k6 options:Execution options
vus- Number of virtual usersduration- Test durationiterations- Total iterationsstages- VU ramping configurationscenarios- Advanced scenario configurationexecutionSegment- Segment of test to runexecutionSegmentSequence- Sequence for segmentation
HTTP options
batch- Max parallel requests in batchbatchPerHost- Max parallel requests per hosthttpDebug- HTTP request/response logginginsecureSkipTLSVerify- Skip TLS verificationtlsAuth- TLS client certificate configurationtlsCipherSuites- TLS cipher suitestlsVersion- Min/max TLS versions
Output options
noConnectionReuse- Disable keep-aliveuserAgent- User-Agent header valuediscardResponseBodies- Don’t save response bodiesrps- Max requests per second
Lifecycle options
setupTimeout- Setup function timeoutteardownTimeout- Teardown function timeoutmaxRedirects- Max HTTP redirects
Tags
tags- Tags applied to all metricssystemTags- System tags to collect
Console output
noVUConnectionReuse- Per-VU connection behaviorminIterationDuration- Minimum iteration durationmaxDuration- Maximum test duration
Examples
Load test with ramping
Spike test
Using environment variables
Related resources
Test lifecycle
Learn about the test execution lifecycle
Scenarios
Advanced VU and iteration scheduling
Thresholds
Set pass/fail criteria for your tests
Environment variables
Using environment variables in k6