Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Increase number of threads in JMeter during execution

I have a performance test in JMeter and would like to test maximum system performance/throughput with it. So number of active threads should be increased for example while Error rate is under 2 %. I found Constant Throughput Timer, put it into Thread Group but it only pause or slow down threads. I tried define it as follows, with a property: ${__P(throughput,)}, but not sure what should be correct value for this property. I can't see how JMeter could measure system maximal performance.

like image 224
plaidshirt Avatar asked Nov 24 '17 11:11

plaidshirt


2 Answers

There is no Out of the box solution as of JMeter 3.3, see this enhancement request:

  • https://bz.apache.org/bugzilla/show_bug.cgi?id=57640

Still it is possible to dynamically add threads since JMeter 3.2 (see https://bz.apache.org/bugzilla/show_bug.cgi?id=60530) in a JSR223 Test Element using JMeterContext:

ctx.getThreadGroup().addNewThread(delay, ctx.getEngine());

So based on this, you could in a JSR223 Test Element (Pre/Post Processor or Sampler) check the presence of a file in a folder of your choice named :

NUMBER_OF_THREAD_TO_ADD.txt

If present, use its name to compute number of threads and call this method.

like image 84
UBIK LOAD PACK Avatar answered Oct 03 '22 19:10

UBIK LOAD PACK


There is no such functionality in the "vanilla" JMeter howere it is possible with plugins, check out:

  • Concurrency Thread Group
  • Throughput Shaping Timer

They can be connected together via feedback loop so Concurrency Thread Group will add more threads if needed to reach the desired number of requests per second.

You can install both the plugins (and keep them up-to-date) using JMeter Plugins Manager

like image 32
Dmitri T Avatar answered Oct 03 '22 17:10

Dmitri T