Skip to main content
The ramping-vus executor (also known as stages) gradually increases or decreases the number of VUs over defined time periods. This is the most common executor for realistic load testing, as it allows you to simulate traffic patterns that ramp up, sustain, and ramp down.

How It Works

With ramping VUs:
  1. VUs start at startVUs (or ramp from 0)
  2. VUs increase/decrease linearly to reach each stage’s target
  3. Each stage has a duration and target VU count
  4. VUs continuously run iterations throughout all stages
  5. Ramping is smooth and linear between targets

Configuration

string
required
Must be ramping-vus
integer
default:"1"
Number of VUs to start with. Can be 0.
array
required
Array of stage objects defining the VU ramping pattern. Each stage must have duration and target.
duration
required
Duration of this stage. Can be 0 for instant VU changes.
integer
required
Target number of VUs at the end of this stage.
duration
default:"30s"
Time to wait for iterations to finish when ramping down VUs. This is separate from gracefulStop.

Example

Classic Load Test Pattern

Spike Test

Stress Test - Find Breaking Point

When to Use

Use the ramping VUs executor when:
  • You want to simulate realistic traffic patterns
  • You need to test how your system handles increasing load
  • You’re performing stress testing to find breaking points
  • You want to observe system behavior during ramp-up and ramp-down
  • You need to give your system time to warm up before peak load
  • You’re testing auto-scaling behavior

Behavior Details

Linear Ramping

VUs increase/decrease linearly between targets:

Zero-Duration Stages

Use duration: '0s' for instant VU changes:

Graceful Ramp Down

When ramping down, VUs get gracefulRampDown time to finish their current iteration:

Maximum VUs Reservation

k6 pre-allocates the maximum number of VUs needed across all stages:

Common Load Test Patterns

Soak Test

Sustained load over a long period:

Breakpoint Test

Continually increase until failure:

Wave Pattern

Simulate traffic waves:

Advanced Configuration

Multiple Ramping Scenarios

Metrics

The executor emits these metrics:
  • iterations - Total completed iterations
  • iteration_duration - Time to complete each iteration
  • vus - Current number of active VUs (changes over time)
  • vus_max - Maximum number of VUs (from peak stage)

Validation

The executor validates that VU targets don’t exceed the sanity limit of 100 million VUs.

Best Practices

  1. Start from zero: Begin with startVUs: 0 to see system behavior from cold start
  2. Include ramp-up: Give your system time to warm up (caches, connection pools, etc.)
  3. Sustain peak load: Hold peak load long enough to observe steady-state behavior
  4. Gradual ramp-down: Avoid instant drops to observe system recovery
  5. Set gracefulRampDown: Allow iterations to complete when ramping down
  6. Monitor throughout: Watch metrics during all stages, not just peak
  7. Use realistic patterns: Model actual traffic patterns from your production data

Comparison with Other Executors

See Also