Skip to main content
The constant-vus executor runs a fixed number of VUs for a specified duration. This is one of the simplest executors and is ideal for steady-state load testing where you want to maintain constant concurrent users.

How It Works

With constant VUs:
  1. A fixed number of VUs start executing
  2. Each VU runs iterations in a loop
  3. Execution continues for the specified duration
  4. VUs run as many iterations as they can complete
  5. All VUs stop when duration expires (plus gracefulStop)

Configuration

string
required
Must be constant-vus
integer
default:"1"
Number of VUs to run concurrently. Must be greater than 0.
duration
required
Total duration of the executor. Must be at least 1 second.

Example

Basic Load Test

This maintains 10 concurrent VUs for 5 minutes, each VU continuously looping through iterations.

With Thresholds

Multiple Constant Load Scenarios

When to Use

Use the constant VUs executor when:
  • You want to maintain a steady load on your system
  • You’re testing how the system performs under sustained concurrent users
  • You need predictable, consistent load over time
  • You’re establishing performance baselines
  • You want to verify system stability under constant load
  • You’re running soak tests to detect memory leaks or degradation

Behavior Details

Iteration Loop

Each VU continuously executes the default function in a loop until duration expires:

No Fixed Iteration Count

Unlike iteration-based executors, there’s no predetermined number of iterations. VUs run as many iterations as they can:

Graceful Stop

When duration expires, running iterations have gracefulStop time to complete:
Execution timeline:
  • 0s - 5m: Regular execution, new iterations can start
  • 5m - 5m30s: Graceful stop period, no new iterations, existing ones finish
  • 5m30s: All VUs forcefully stopped

Metrics

The executor emits these metrics:
  • iterations - Total completed iterations
  • iteration_duration - Time to complete each iteration
  • vus - Number of active VUs (constant at configured value)
  • vus_max - Maximum number of VUs (same as vus)

Common Patterns

Soak Testing

Test system stability over extended periods:

Steady Background Load

Maintain background load while testing something else:

Different Iteration Speeds

Comparison with Other Executors

Best Practices

  1. Set realistic duration: Ensure duration matches your test objectives
  2. Include think time: Use sleep() to simulate realistic user behavior
  3. Monitor resource usage: Watch system resources throughout the constant load
  4. Use for baselines: Great for establishing performance baselines before ramping tests
  5. Configure gracefulStop: Allow enough time for iterations to complete cleanly
  6. Consider iteration duration: Faster iterations = more iterations = more load

Duration Requirements

The duration must be at least 1 second. For very short tests, consider using iteration-based executors instead.

See Also