It is not clear to me how I can control a closed workload model in Gatling.
If I use constantConcurrentUsers
, like this:
myScenario.inject(
constantConcurrentUsers(40) during (2 minutes)
)
I thought it meant the number of active users would be constant. But instead, I get reports like this:
Where the number of users is not constant and 3-5 times more than what I wanted.
In the console output though, I can see that something is constant (4 scenarios here, each loaded with 10 constant concurrent users):
But the total load is much more than I would expect.
I had experimented with throttling, and the results had been clear there. In my understanding, the throttle maximizes the number of concurrently active requests (a request is active if it has been sent but not yet responded to). I define a number of requests that should go through, and Gatling sends a new request every time one is done. And because there is not much difference between response times, a report looks like this:
I wanted to do the same thing but so that I can control the length of the simulation, not the total amount of requests sent. constantConcurrentUsers
seemed to be just the thing I needed, but it produces unexpected results. My throttle simulation does approximately 3000 requests in about 1 minute with a throttle of 50. At the same time, if I set 50 concurrent users for 1 minutes, there are more than 7000 requests sent in the report. Response times are way lower in the throttle case. So the throttle simulation sends requests much slower than the concurrent users simulation, but not because the requests take more time.
I know that active users and sent requests are not the same and constantConcurrentUsers
controls the number of users while throttle controls requests. But all my scenarios contain only one request so I don't understand the difference between the results.
So my questions are:
- What exactly is constant when I use
constantConcurrentUsers
? - How is the number of requests calculated when I use
constantConcurrentUsers
? - What is the relation between "active users" in the report and "active" in the console output?
I have read this part of the Gatling documentation, which is really short and lacks a detailed description. I also read this article, which has graphs I have never seen in any Gatling report and doesn't answer my question.
Thank you for any contribution.