How to implement specific counts of thread in Gatling









































|

Is there any possibility to setup Gatling scenario to run in specific counts of thread? For instance, I want to execute 1M requests during 1hour in 2500 threads.



And also, does each scenario (in setUp(scn.inject())) will be running in different thread? What does “thread” means in Gatling-definition - is it the same as in Java?



I found a topic, but it’s not exactly what I need (in case of topic-started he needed only 3 threads, but for me - counts much bigger).



I have



val scn = scenario(“Test”)



.exec(mine)



}








setUp(



scn.inject(



rampUsers(1000000) over (3600)



)



).assertions(global.successfulRequests.percent.greaterThan(95))

|

  • | - |

This question means that you have some background with another tool, that got you used to reason on things, like threads, that should be an implementation detail.

With Gatling, you have to reason in terms of users, injection/arrival rates, and pauses/think time. Threads are just technical resources that are no concern for you, forget about them.

For my case this resources concern are really critical. Customer whats to be sure, that I producing load with (for instance, exactly 250 threads, more of that - he wants to setup this number manually).

Is it possible to maybe “extend” gatling functionality by overriding it for make this things happen? Or still will be better to use some other tool in front of gatling calls?

Thanks in advance!

Gatling thread usage is related to the number of cores on your machine. There’s a ratio between 4 and 5.

Customer whats to be sure, that I producing load with (for instance, exactly 250 threads, more of that - he wants to setup this number manually).

I think you keep on confusing threads (technical resources, implementation detail, not a user concern) and concurrent users.

When you hear your client say “thread” just translate that in your head to “concurrent user”. Because that’s what they mean. To get 2500 concurrent users, you need to set up your scenario to loop for some duration, and inject 2500 users. That will give you what you want.