Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Increase load for stress testing #74

Merged
merged 2 commits into from
Apr 29, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 4 additions & 5 deletions docker-compose.gatling.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ services:
- POSTGRES_MAX=20
- POSTGRES_DATABASE=fide
- CRAWLER_JOB_DELAY=1
- CRAWLER_CONCURRENT_UPSERT=20
- CRAWLER_CONCURRENT_UPSERT=10
ports:
- 9669:9669
networks:
Expand All @@ -24,10 +24,10 @@ services:
resources:
limits:
cpus: "4"
memory: 512M
memory: 16G
reservations:
cpus: "2"
memory: 250M
memory: 8G

db:
image: postgres:16.2-alpine3.19
Expand All @@ -40,13 +40,12 @@ services:
- 5432:5432
networks:
- fide_api
command: postgres -c shared_preload_libraries=pg_stat_statements -c pg_stat_statements.track=all
restart: unless-stopped
deploy:
resources:
limits:
cpus: "4"
memory: 2G
memory: 8G
reservations:
cpus: "2"
memory: 1G
Expand Down
11 changes: 3 additions & 8 deletions modules/gatling/src/test/scala/gatling/CapacitySimulation.scala
Original file line number Diff line number Diff line change
Expand Up @@ -7,17 +7,12 @@ class CapacitySimulation extends Simulation:

import SimulationHelper.*

val user = 1000
val capcity = makeScenario(2, "capacity").inject(
// generate an open workload injection profile
// with levels of 10, 15, 20, 25 and 30 arriving users per second
// each level lasting 10 seconds
// separated by linear ramps lasting 10 seconds
incrementUsersPerSec(5.0)
.times(5)
incrementUsersPerSec(100.0)
.times(10)
.eachLevelLasting(10)
.separatedByRampsLasting(10)
.startingFrom(20) // Double
.startingFrom(50) // Double
)

setUp(capcity).protocols(httpProtocol)
4 changes: 2 additions & 2 deletions modules/gatling/src/test/scala/gatling/StressSimulation.scala
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ class StressSimulation extends Simulation:

import SimulationHelper.*

val nbUsers = 250
val stress = makeScenario(5, "stress").inject(rampUsers(nbUsers).during(30.seconds))
val nbUsers = 12000
val stress = makeScenario(10, "stress").inject(rampUsers(nbUsers).during(30.seconds))

setUp(stress).protocols(httpProtocol)
5 changes: 3 additions & 2 deletions modules/gatling/src/test/scala/gatling/WarmupSimulation.scala
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ class WarmupSimulation extends Simulation:

import SimulationHelper.*

val nbUsers = 100
val warmup = makeScenario(1, "warmup").inject(rampUsers(nbUsers).during(30.seconds))
val nbUsers = 2000
val warmup = makeScenario(10, "warmup").inject(rampUsers(nbUsers).during(30.seconds))

setUp(warmup).protocols(httpProtocol)
Loading