In this article, we will describe when it might be best to use each type of JMeter Thread Group. Examples of test plan elements that a thread group may contain include HTTP samplers, logical preprocessors and postprocessors, timers, and many other components within a test plan. The most elementary component is the basic Thread Group, which is a simple container for requests and other operations in many JMeter tests.
Types of JMeter Thread Groups
JMeter offers numerous types of thread groups that we have covered in previous blog posts:
- The basic Thread Group
- Stepping Thread Group
- Ultimate Thread Group
- Concurrency Thread Group
- The basic Arrivals Thread Group
- Free-Form Arrivals Thread Group
- Open Model Thread Group
For additional convenience, we have summarized various common use cases and mapped them to the corresponding best-suited choice of thread group in the table below:
Despite its simplicity, there are many scenarios where the basic Thread Group would be preferred over some of the more advanced components. Most of these stem from organizing simple operations, ranging from investigating a proof-of-concept to creating reusable groupings for test plan scripting. A few examples of where the basic Thread Group is typically used includes the following:
- In cases where the test designer is investigating a proof-of-concept and a simple test plan architecture is preferred.
- Small-scale or functional testing against a development environment or production based systems.
- If your test contains complex scripted decision tree logic, Thread Groups are an easy way to separate simple components into reusable sections for more advanced test logic to perform complex operations.
When scaling a load test, often it can be challenging to do so with the basic Thread Group. There are limited options and multiple variables to manage. Using one of the Custom Thread Groups can greatly simplify scalability by managing several of these variables at once:
- A common feature of the Custom Thread Groups is a projection of load over time, which can greatly assist for test planning purposes.
- For load tests designed to probe the saturation point for a target test application, the Ultimate Thread Group and Stepping Thread Groups are good choices.
- For tests which require large changes in scale, the Concurrency Thread Group provides an easy way of adjusting scale with minimal configuration changes between test runs.
- Any test which models a complex load profile (such as spike testing or a surge test) can potentially be simplified using the Ultimate Thread Group.
Tests which target enterprise-level scalable infrastructure and demand large changes are suitable candidates for either of the Arrivals Thread Groups. We have a separate post which details specific use cases for these components. A principal advantage is that large changes in scalability are achieved by small modifications. Some examples of use cases for the Arrivals Thread Groups include:
- Probing the breaking point of large scale target test applications where the ultimate load is not definitely known but thought to be large.
- Defining a load test where the rate of new requests is more important than the total number of requests at any given time.
- Creating a scalable profile that can be exponentially scaled by changing a single variable.
Though still marked as an experimental feature, the Open Model Thread Group offers the greatest flexibility in configuring complex load profiles. In a related post we have detailed how to set up and use this component. The defining difference is in that load is profiled with programmatic configuration. This can be integrated with Groovy or JSR223 scripting.
- Modeling complex load behaviors that are more conducive to scripting rather than defining a static load profile.
- Defining load profiles using a pre-configured code-based template that can easily be modified by simply changing one or more lines of code.
There are many factors to consider when selecting the best JMeter thread group for your load test. The scenarios described here represent some common examples and which thread group may work best. Your test may have unique requirements which may dictate the use of a different thread group. To learn more about each thread group type, please check out our YouTube channel.
Did you know that RedLine13 offers a full-featured, time-limited free trial? Sign up now and start testing with JMeter thread groups in the cloud today.