最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

javascript - Constant load (x new requests per second) - Stack Overflow

programmeradmin6浏览0评论

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.

Share Improve this question edited Dec 19, 2017 at 12:23 user1010 asked Dec 19, 2017 at 11:52 user1010user1010 3791 gold badge5 silver badges19 bronze badges
Add a ment  | 

2 Answers 2

Reset to default 7

k6 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?

发布评论

评论列表(0)

  1. 暂无评论