0
votes

I've got a distributed JMeter setup and I want to create a Java service wrapper around it.

The test plan (JMX file) is provided by the user. Hence, I don't know the properties and config used in there. The user test plan can have multiple thread groups and potentially custom thread group plugins like Ultimate Thread Group, Arrival Thread Group, etc.

  1. I want to get the overall maximum #threads or maximum concurrency (active threads) that can be achieved by the user test plan. Is it possible to get this value before executing the test plan? This will help me to provision servers for this test run accordingly.

  2. Is it possible to cap the overall max concurrency achieved by the test plan? (similar to what we can do with RPS using timers) (Also, please mention options for custom thread groups like Ultimate thread group)

1

1 Answers

1
votes

This is not something you can efficiently control because:

  1. It is possible to configure JMeter to kick off extra threads if current amount is not sufficient to reach/maintain the target throughput by using i.e. Throughput Shaping Timer and Concurrency Thread Group with feedback function

  2. Users can use properties or functions/variables to parameterize/calculate the concurrency

  3. Users can always use JSR223 Test Elements and do something like:

    ctx.getThreadGroup().addNewThread(0, ctx.getEngine()) 
    

    and this is not something you can detect because there are numerous ways of invoking this function including reflection

So the maximum you could do is to rely on JVM limits, by default you have 1 megabyte of stack size per thread which gives your 1024 threads for each gigabyte of memory allocated to Java so you can either increase stack size or decrease the memory allocated to the JVM according to your "caps"