grafana/k6 · error

target for stage %d exceeds max limit of %d

Error message

target for stage %d exceeds max limit of %d

What it means

Raised by validateTargetShifts (called from RampingVUsConfig.Validate) for a stage whose target VU count exceeds maxConcurrentVUs, the internal cap on concurrent VUs. The %d placeholder is the offending stage index.

Source

Thrown at lib/executor/ramping_vus.go:734

}

// validateTargetShifts validates the VU Target shifts.
// It will append an error for any VU target that is larger than the maximum value allowed.
// Each Stage needs a Target value. The stages array can be empty. The Targes could be negative.
//
// TODO: after https://github.com/grafana/k6/issues/1499 this validation
// function could be useless.
func validateTargetShifts(startVUs int64, stages []Stage) []error {
	var errors []error

	if startVUs > int64(maxConcurrentVUs) {
		errors = append(errors, fmt.Errorf(
			"the startVUs exceed max limit of %d", maxConcurrentVUs))
	}

	for i := range stages {
		if stages[i].Target.Int64 > int64(maxConcurrentVUs) {
			errors = append(errors, fmt.Errorf(
				"target for stage %d exceeds max limit of %d", i+1, maxConcurrentVUs))
		}
	}

	return errors
}

View on GitHub (pinned to 01ffac6f24)

Solutions

  1. Reduce the offending stage's target to at most maxConcurrentVUs
  2. Split the load across several scenarios or run multiple distributed k6 instances
Defensive patterns

Strategy: validation

When it happens

Trigger: Thrown at lib/executor/ramping_vus.go:734 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of grafana/k6@01ffac6f24 (2026-08-18). Data as JSON: /api/errors/d576948f9629d7d9. Report an issue: GitHub.