How does it work with a vuser whose script contains pause statement - does it monopolize resources?

Hi Gatling community! I hope everyone is having a nice day wherever you are.

I have a question mostly about how Gatling works under the covers. I have a script scenario that is like:

  1. Make a POST request.
  2. Receive a custom status back in the response body.
  3. The custom status will either say DONE or something to the effect of “Poll for status using GET in N milliseconds”.
  4. Repeat Steps #2 and #3 until a status comes back of DONE.

In my script I check for DONE or else pause() for N milliseconds then make the GET request and the script will poll for status as expected.

Basically, make a request and then poll for status for however long it takes to reach DONE status. I’m going to stress test what happens when N grows large and users accumulate.

As the value of N grows and the number of times required to poll grow the VUser will run longer. And as I add more concurrent VUsers per second the number of VUsers that are not finishing will grow.

My question is:

When the VUser performs a pause() does it yield its resources back until it is ready to run again?

I ask because I’m trying to understand the kind of resources needed to support Gatling for my test. If each VUser that runs requires X resources until finished then my resources required are quite huge.

But if during the pause() the VUser is taking limited resources (I’m avoiding using threads as an anology!) until it wakes up from pause() then this is a much different and better calculation. :smile: This is especially true when N is “large” and the VUser could be paused for a longer period. If the paused VUser is using less resources that is great!

Hope the question makes sense. Have a good day!

pause() schedules the virtual user to be reactivated later, it doesn’t monopolize shared resources.

On the contrary, doing a Thread.sleep in a function would ruin everything.

1 Like

This is so helpful for my planning, thank you! :grinning: