Prathap Reddy
Prathap Reddy

Reputation: 43

Can we increase Thread count in JMeter during load test ? not scheduled increment..!

Can we increase Thread count in JMeter during load test ? i am using Jmeter3.2 version , how can i configure this or increase thread count during load test

Upvotes: 1

Views: 1936

Answers (4)

Dmitri T
Dmitri T

Reputation: 168147

You cannot manipulate the number of threads (virtual users) however you can control the number of requests per minute (aka throughput) in the real time, it should be a feasible alternative.

  1. Add Constant Throughput Timer to your Thread Group
  2. Define desired initial throughput as a JMeter Property using __P() function like ${__P(throughput,)}:

    JMeter Constant Throughput Timer

  3. That's it, now you can control how often your requests are executed by modifying throughput property for example using __setProperty() function. Moreover, you can even do this outside of JMeter via for example Beanshell Server

Upvotes: 0

klingac
klingac

Reputation: 463

You can use plugin Ultimate thread group. You'll have to set it up before running the test. Unfortunately, you will not be able to add threads manually during the test.

Upvotes: 0

timbre timbre
timbre timbre

Reputation: 13996

You cannot increase number of threads (as Vins said), but you can start maximum threads you need, and get most threads to idle until test tells them to do something.

For example: lets say you want to start with 5 threads, and increase them to 10 when myVar becomes true:

Thread Group 
 Number of threads: 10

    While Controller 
     Condition: ${__javaScript(${__threadNum} > 5 && '${myVar}' != 'true')}

       Constant Timer <-- thread will idle here for a bit and check condition again

    Samplers <-- when not idling, script starts here

So threads above 5 will idle under While Controller, checking condition periodically (period is dictated by Constant Timer). When condition is no longer satisfied, they will exit While and continue with script execution.

Of course this just shows a method, you can tailor it to your needs (e.g. condition can be simple or complex, you can enable and disable threads dynamically by modifying variable multiple times, and so on).

Upvotes: 3

vins
vins

Reputation: 15400

You can parameterize the thread count using variables / properties. However once the test started, say with 5 threads, you can not change it to 10 threads while the test is running.

Upvotes: 1

Related Questions