Skip to content
Advertisement

Constant load (x new requests per second)

Is there a way to to configure a performance test case with constant load (say, 3 new requests per second for 1 minute)?

Other load testing libraries have this feature to set the request rate (e.g. Artillery.io, Vegeta). k6 has a way to set VUs, but VU does not make a new request until the previous iteration is finished.

Advertisement

Answer

k6 actually has this feature now, in the master branch (https://github.com/loadimpact/k6/issues/211 was closed 5 days ago) – either you can download and compile master (go get github.com/loadimpact/k6 if you have Go installed) or you can just wait a little and it will be in the next release. Shouldn’t take more than a week or so before we make a new release.

You use the RPS limiter feature by adding the rps parameter, either on the command line as an option to the run command: k6 run --rps 100 ... or as options.rps:

export let options = { vus: 50, rps: 100 }

Note that this feature is just limiting the max RPS rate k6 will produce. If you use too few VU threads you will not reach the desired RPS rate. Exactly how many VUs you’ll need to use depends on how fast transactions complete. That, in turn, is dependent on network delay and server processing time. In general, using 100-200 VU should cover most common situations.

User contributions licensed under: CC BY-SA
5 People found this is helpful
Advertisement