Hold 150 active users for 2 hours


Trying to run a performance test that will hold 150 active users for 2 hours. Im currently using rampUsers(40000) over(2 hours)) but it seems to spike very high and stabalize at around 10% of the users after a while.

I’d love to hold around 150 active users the whole 2 hour period, what is the correct configuration to do this?


I’ll extend question a bit… how do you build a scenario that keeps number of users like below jmeter thread group

I’ve made something similar to what you want this way:

Basically it’s a forever loop with a rampup and a max duration (that breaks the forever loop)

val myScenario = scenario(“My Scenario”)
.exec(…) //your execution

rampUsers(4000) over (200 seconds) //the ramp up curve
).maxDuration(2 hours) // the time the forever loop will run with the total amount of users at the rampup.

In this case it looks like you are injecting a constant number of users every second or so.
You can have this kind of behaviour using “constantUsersPerSec”.
Take a look at the cheat sheet:


in conjunction with the answer I gave to the previous question you can achieve this.