Skip to main content
The per-vu-iterations executor ensures that each VU runs an exact number of iterations. Unlike shared iterations where VUs compete for iterations, here every VU completes its own fixed quota of iterations.

How It Works

With per-VU iterations:
  1. Each VU is assigned a fixed number of iterations
  2. VUs run independently without competing
  3. Total iterations = vus × iterations
  4. Each VU completes all its iterations or runs until maxDuration
  5. All VUs complete the same number of iterations (if within maxDuration)

Configuration

string
required
Must be per-vu-iterations
integer
default:"1"
Number of VUs to run concurrently. Must be greater than 0.
integer
default:"1"
Number of iterations each VU executes. Must be greater than 0.
duration
default:"10m"
Maximum duration for the executor. If a VU’s iterations don’t complete within this time, remaining iterations are dropped.

Example

Basic Configuration

This runs 10 VUs, each executing 20 iterations, for a total of 200 iterations.

Per-User Session Simulation

When to Use

Use the per-VU iterations executor when:
  • You want consistent work per VU (e.g., each user completes 10 sessions)
  • You need predictable per-VU behavior for testing
  • You’re simulating realistic user behavior where each user does a set amount of work
  • You want the total iterations to scale linearly with VUs
  • You need to test with isolated per-VU data or state

Behavior Details

Total Iterations

The total number of iterations is the product of VUs and iterations per VU:

VU Isolation

Each VU maintains its own iteration counter and executes independently:

Maximum Duration

If a VU cannot complete all iterations within maxDuration, remaining iterations are dropped:
Dropped iterations are tracked per VU in the dropped_iterations metric.

Scaling Behavior

When using execution segments for distributed testing, only VUs are scaled, NOT iterations per VU. This maintains linear scaling.
Example with 50% execution segment:

Metrics

The executor emits these metrics:
  • iterations - Total completed iterations across all VUs
  • iteration_duration - Time to complete each iteration
  • dropped_iterations - Iterations that didn’t complete within maxDuration (tracked per VU)
  • vus - Number of active VUs
  • vus_max - Maximum number of VUs

Common Patterns

User Journey Testing

Per-VU Data Processing

Ramping Users with Fixed Work

Combine with other executors for complex scenarios:

Comparison with Shared Iterations

Best Practices

  1. Set realistic maxDuration: Ensure each VU has enough time to complete all iterations
  2. Use for user simulation: Great for simulating N users each doing M actions
  3. Monitor per-VU metrics: Use __VU and __ITER to track per-VU behavior
  4. Consider VU reuse: VUs are reused across iterations, so handle state appropriately
  5. Plan for scaling: Remember only VUs scale in distributed testing, not iterations

See Also