Key Concepts
Virtual Users (VUs)
Simulated concurrent users making requests. More VUs = higher load on your system.
Load Patterns
How load is applied over time: constant, ramping up/down, fixed iterations, or arrival rate.
Thresholds
Pass/fail criteria based on response times, error rates, or throughput.
Test Location
Geographic origin of the load test, affecting network latency to your servers.
How to Create a Single Request Test
Test a single API endpoint with configurable load.Configure the Request
- Select the HTTP method (GET, POST, PUT, PATCH, DELETE)
- Enter the target URL (e.g.,
https://api.example.com/users) - Click Settings to add headers, query params, request body, or authentication
Choose a Load Pattern
Select one of the four load patterns:
- Constant VUs: Fixed number of users for a set duration
- Ramping VUs: Gradually increase/decrease users over stages
- Per VU Iterations: Each user runs a fixed number of requests
- Constant Arrival Rate: Maintain a fixed request rate regardless of response time
How to Create a Multi-Step Test
Chain multiple API requests to test user flows (login → fetch data → submit form).Add Steps
Click Add Step to create each request in the flow. For each step:
- Name: Descriptive name (e.g., “Login”, “Get User Profile”)
- URL: The endpoint URL
- Method: HTTP method
- Headers/Body: Request configuration
Configure Variable Extractors
Extract values from responses to use in subsequent steps:
- Source: body, header, or status
- Path: JSONPath expression (e.g.,
$.data.token) - Variable Name: Reference in later steps as
{{variableName}}
Add Assertions
Validate each step’s response:
- Status code equals 200
- Body contains specific value
- Response time under threshold
In multi-step mode, each virtual user executes all steps in sequence. The total iteration duration includes all steps plus any configured think time between them.
Load Pattern Reference
Constant VUs
Runs a fixed number of virtual users continuously for the specified duration.| Parameter | Description | Example |
|---|---|---|
| VUs | Number of concurrent users | 10 |
| Duration | How long to run | 30s, 5m, 1h |
Ramping VUs
Gradually increases or decreases load through defined stages.| Parameter | Description | Example |
|---|---|---|
| Stages | List of (duration, target VUs) pairs | 10s→10, 20s→50, 10s→0 |
- Linear Ramp: Gradual load increase
- Spike Test: Sudden load spike then recovery
- Stress Test: Progressive overload to find breaking point
Per VU Iterations
Each virtual user executes the test script a fixed number of times.| Parameter | Description | Example |
|---|---|---|
| VUs | Number of concurrent users | 5 |
| Iterations | Requests per user | 100 |
Constant Arrival Rate
Maintains a constant rate of new requests regardless of response time.| Parameter | Description | Example |
|---|---|---|
| Rate | Requests per time unit | 50 |
| Time Unit | Per second or per minute | 1s |
| Duration | Total test duration | 2m |
How to Configure Request Settings
Click the Settings button to open the configuration drawer.Query Parameters
Add URL query parameters:- Click Add Parameter
- Enter key and value
- Parameters are appended to the URL automatically
Headers
Add custom HTTP headers:- Click Add Header
- Enter header name and value (e.g.,
Content-Type: application/json)
Request Body
For POST, PUT, PATCH requests:- Select body type: JSON, XML, or Text
- Enter the request body content
- JSON is validated before test execution
Authentication
Configure request authentication:| Type | Parameters |
|---|---|
| Basic Auth | Username, Password |
| Bearer Token | Token value |
| API Key | Key name, Key value, Pass by (header/query) |
Options
| Option | Description | Default |
|---|---|---|
| Follow Redirects | Automatically follow HTTP redirects | Enabled |
| Enable HTTP/2 | Use HTTP/2 protocol if supported | Disabled |
| Timeout | Request timeout in seconds | 30 |
How to Set Performance Thresholds
Thresholds define pass/fail criteria for your test.Add a Threshold
Click Add Threshold and configure:
- Metric: What to measure (p50, p90, p95, p99, avg, errorRate, throughput)
- Operator: Comparison (less than, greater than, equals)
- Value: Target value
- Severity: Error (fails test) or Warning (flags but passes)
| Metric | Condition | Description |
|---|---|---|
| p95 | < 500ms | 95th percentile latency under 500ms |
| p99 | < 1000ms | 99th percentile under 1 second |
| errorRate | < 1% | Less than 1% failed requests |
| throughput | > 100 | At least 100 requests per second |
How to Select Test Location
Choose where load originates geographically.During Test Execution
After clicking Launch Test:- Status Panel: Shows real-time test progress
- Live Metrics: Requests, latency, success rate update in real-time
- Logs: K6 execution output streams live
- Auto-Navigation: Redirects to detailed results when complete
You can navigate away during execution. Return to New Test page to see the active test panel, or check Test Results for completed tests.
Troubleshooting
Test fails to start
Test fails to start
- Verify the URL is valid and accessible from the internet
- Check that authentication credentials are correct
- Ensure the target server allows requests from proxy IPs
All requests fail
All requests fail
- Check the target URL is reachable
- Verify SSL certificates if using HTTPS
- Review request headers and body format
- Check for rate limiting or IP blocking on target server
Latency higher than expected
Latency higher than expected
- Consider the geographic distance between test location and server
- Check if your server is under load from other sources
- Review if authentication adds overhead
Cannot add steps in multi-step mode
Cannot add steps in multi-step mode
- Ensure you’ve switched to Multi-Step mode
- Each step requires at minimum a name and URL
Variable extraction not working
Variable extraction not working
- Verify the JSONPath expression is correct
- Ensure the previous step returns the expected response structure
- Check that variable names don’t contain special characters
FAQ
How many VUs can I use?
How many VUs can I use?
You can configure 1 to 1000 virtual users per test. Higher VU counts generate more load but consume more resources.
What's the difference between VUs and requests?
What's the difference between VUs and requests?
VUs are concurrent users. Each VU makes multiple requests during the test. Total requests depends on VU count, duration, and response times.
Can I test internal/private APIs?
Can I test internal/private APIs?
Load tests run from external proxy servers. Internal APIs must be accessible from the internet. For private APIs, consider VPN or expose via secure gateway.
How are results stored?
How are results stored?
Test results are stored permanently and accessible from Test Results page. You can compare tests and set baselines for regression detection.
Can I schedule recurring tests?
Can I schedule recurring tests?
Use Test Plans to save configurations and run them on demand or integrate with CI/CD pipelines.
What happens if I close the browser during a test?
What happens if I close the browser during a test?
Tests continue running server-side. Return to the New Test page or check Test Results to see status and results.