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.