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.
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.
2 Answers
Reset to default 7k6 actually has this feature now, in the master branch (https://github./loadimpact/k6/issues/211 was closed 5 days ago) - either you can download and pile master (go get github./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 mand line as an option to the run
mand: 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 plete. That, in turn, is dependent on network delay and server processing time. In general, using 100-200 VU should cover most mon situations.
As of k6 v0.27, there is now native support for constant arrival rates, aka. constant request rate. In the following article, I have explained how to generate a constant request rate in k6 with the new scenarios API:
How to generate a constant request rate in k6 with the new scenarios API?
发布者:admin,转转请注明出处:http://www.yc00.com/questions/1744294575a4567198.html
评论列表(0条)