1
0
mirror of https://github.com/bitwarden/server.git synced 2025-04-05 21:18:13 -05:00

Add complexity to load tests via scenarios (#3034)

This commit is contained in:
Matt Bishop 2023-07-03 10:30:05 -04:00 committed by GitHub
parent b0214ae1be
commit 693f79c041
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 79 additions and 21 deletions

View File

@ -15,15 +15,35 @@ export const options = {
name: "Config", name: "Config",
}, },
}, },
scenarios: {
constant_load: {
executor: "constant-arrival-rate",
rate: 1,
timeUnit: "1s", // 1 request / second
duration: "10m",
preAllocatedVUs: 5,
},
ramping_load: {
executor: "ramping-arrival-rate",
startRate: 60,
timeUnit: "1m", // 1 request / second to start
stages: [ stages: [
{ duration: "30s", target: 10 }, { duration: "30s", target: 60 },
{ duration: "1m", target: 20 }, { duration: "2m", target: 150 },
{ duration: "2m", target: 25 }, { duration: "1m", target: 90 },
{ duration: "2m", target: 200 },
{ duration: "2m", target: 120 },
{ duration: "1m", target: 180 },
{ duration: "30s", target: 250 },
{ duration: "30s", target: 90 },
{ duration: "30s", target: 0 }, { duration: "30s", target: 0 },
], ],
preAllocatedVUs: 40,
},
},
thresholds: { thresholds: {
http_req_failed: ["rate<0.01"], http_req_failed: ["rate<0.01"],
http_req_duration: ["p(95)<1000"], http_req_duration: ["p(95)<750"],
}, },
}; };

View File

@ -16,15 +16,35 @@ export const options = {
name: "Groups", name: "Groups",
}, },
}, },
scenarios: {
constant_load: {
executor: "constant-arrival-rate",
rate: 30,
timeUnit: "1m", // 0.5 requests / second
duration: "10m",
preAllocatedVUs: 5,
},
ramping_load: {
executor: "ramping-arrival-rate",
startRate: 30,
timeUnit: "1m", // 0.5 requests / second to start
stages: [ stages: [
{ duration: "30s", target: 10 }, { duration: "30s", target: 30 },
{ duration: "1m", target: 20 }, { duration: "2m", target: 75 },
{ duration: "2m", target: 25 }, { duration: "1m", target: 60 },
{ duration: "2m", target: 100 },
{ duration: "2m", target: 90 },
{ duration: "1m", target: 120 },
{ duration: "30s", target: 150 },
{ duration: "30s", target: 60 },
{ duration: "30s", target: 0 }, { duration: "30s", target: 0 },
], ],
preAllocatedVUs: 20,
},
},
thresholds: { thresholds: {
http_req_failed: ["rate<0.01"], http_req_failed: ["rate<0.01"],
http_req_duration: ["p(95)<1500"], http_req_duration: ["p(95)<900"],
}, },
}; };

View File

@ -12,15 +12,33 @@ export const options = {
name: "Login", name: "Login",
}, },
}, },
scenarios: {
constant_load: {
executor: "constant-arrival-rate",
rate: 2,
timeUnit: "1s", // 2 requests / second
duration: "10m",
preAllocatedVUs: 10,
},
ramping_load: {
executor: "ramping-arrival-rate",
startRate: 60,
timeUnit: "1m", // 1 request / second to start
stages: [ stages: [
{ duration: "30s", target: 10 }, { duration: "30s", target: 60 },
{ duration: "1m", target: 20 }, { duration: "5m", target: 120 },
{ duration: "2m", target: 25 }, { duration: "2m", target: 150 },
{ duration: "1m", target: 180 },
{ duration: "30s", target: 200 },
{ duration: "30s", target: 90 },
{ duration: "30s", target: 0 }, { duration: "30s", target: 0 },
], ],
preAllocatedVUs: 25,
},
},
thresholds: { thresholds: {
http_req_failed: ["rate<0.01"], http_req_failed: ["rate<0.01"],
http_req_duration: ["p(95)<3000"], http_req_duration: ["p(95)<1500"],
}, },
}; };