{"record":{"id":"e7a5270a3c6f4a50","repo":"grafana/k6","slug":"the-startvus-exceed-max-limit-of-d","errorCode":null,"errorMessage":"the startVUs exceed max limit of %d","messagePattern":"the startVUs exceed max limit of (.+?)","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"lib/executor/ramping_vus.go","lineNumber":728,"sourceCode":"\t\t\tcase <-timer.C:\n\t\t\t\t// now we do a step\n\t\t\t}\n\t\t}\n\t\treturn false\n\t}\n}\n\n// validateTargetShifts validates the VU Target shifts.\n// It will append an error for any VU target that is larger than the maximum value allowed.\n// Each Stage needs a Target value. The stages array can be empty. The Targes could be negative.\n//\n// TODO: after https://github.com/grafana/k6/issues/1499 this validation\n// function could be useless.\nfunc validateTargetShifts(startVUs int64, stages []Stage) []error {\n\tvar errors []error\n\n\tif startVUs > int64(maxConcurrentVUs) {\n\t\terrors = append(errors, fmt.Errorf(\n\t\t\t\"the startVUs exceed max limit of %d\", maxConcurrentVUs))\n\t}\n\n\tfor i := range stages {\n\t\tif stages[i].Target.Int64 > int64(maxConcurrentVUs) {\n\t\t\terrors = append(errors, fmt.Errorf(\n\t\t\t\t\"target for stage %d exceeds max limit of %d\", i+1, maxConcurrentVUs))\n\t\t}\n\t}\n\n\treturn errors\n}\n","sourceCodeStart":710,"sourceCodeEnd":741,"githubUrl":"https://github.com/grafana/k6/blob/01ffac6f245854c1b8adc6a69857c76a15f90022/lib/executor/ramping_vus.go#L710-L741","documentation":"Raised by validateTargetShifts (called from RampingVUsConfig.Validate) when startVUs exceeds maxConcurrentVUs, the hard internal cap on concurrently running VUs. This guards against configurations that could exhaust system resources.","triggerScenarios":"Thrown at lib/executor/ramping_vus.go:728 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Lower startVUs to at most the maxConcurrentVUs limit","Distribute load across multiple scenarios or k6 instances instead of one huge VU count"],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"01ffac6f245854c1b8adc6a69857c76a15f90022","analyzedAt":"2026-08-18T03:05:52.393Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}