No results for

Powered byAlgolia

Instant load increase

One of the common usages of load testing tools it's the so-called stepped arrival rate.

In k6 we can achieve it with the following configuration.

Here's an example on how to instantly increase the number of iterations and hold them for a period of time.

instant-load-increase.js
1export const options = {
2 scenarios: {
3 contacts: {
4 executor: 'ramping-arrival-rate',
5 preAllocatedVUs: 50,
6 timeUnit: '1s',
7 startRate: 50,
8 stages: [
9 { target: 200, duration: '30s' }, // linearly go from 50 iters/s to 200 iters/s for 30s
10 { target: 500, duration: '0' }, // instantly jump to 500 iters/s
11 { target: 500, duration: '10m' }, // continue with 500 iters/s for 10 minutes
12 ],
13 },
14 },
15};

Here's an example on how to instantly increase the number of VUs and hold them for a period of time.

instant-load-increase.js
1export const options = {
2 scenarios: {
3 contacts: {
4 executor: 'ramping-vus',
5 preAllocatedVUs: 10,
6 startVUs: 3,
7 stages: [
8 { target: 20, duration: '30s' }, // linearly go from 3 VUs to 20 VUs for 30s
9 { target: 100, duration: '0' }, // instantly jump to 100 VUs
10 { target: 100, duration: '10m' }, // continue with 100 VUs for 10 minutes
11 ],
12 },
13 },
14};