• info@helpingtesters.com
  • helpingtesters

Understanding Thread Group in JMeter

September 10, 2017 JMeter Tutorial
Thread Group in JMeter, jmeter thread group, jmeter multiple thread groups, thread group jmeter

In this blog, we will cover another important component of JMeter i.e. Thread group. “Thread group” in JMeter decides the number of users to be simulated and number of times that they need to hit JMeter servers. Based on the values set, each thread group in jmeter or user will begin to run from the first request as the thread group is set at the global level. This plays a crucial role in putting a load on the application under test and analyzing response times, CPU utilization, memory leaks etc. Let’s try to understand components of JMeter one by one and see their part in creating the desired load. 

→Complete list of JMeter Tutorial Series

⇒ Adding Thread Group in JMeter

Right click on Test Plan > Add > Thread Groups > Thread Group


⇒ UI of Thread Group in JMeter

Clicking “Thread group” component on the left panel will load the right panel as highlighted

Let’s discuss various components of Thread group one by one and what impact it will have on changing values in each field :

⇒ Action to be taken after Sampler Error

Once the test is running then either the request will fail or pass. If the test is running for multiple threads then one can decide the behavior of thread, in either case, using options provided. Below are various options :

  • Continue: In event of failure continue and move to the next request. By default value is set as “Continue”.
  • Start Next Thread Loop: To Stop Thread and Start Next
  • Stop Thread: To stop current Thread in event of failure
  • Stop Test: To stop entire test execution
  • Stop Test Now: The whole test will be stopped

⇒ Thread Group in JMeter Properties

  • Number of Threads (users): Number of users
  • Ramp-Up Period (in seconds): It is the time that JMeter will take to put all the users running on the application. For Example: If “Number of Threads” is set to “10”, and “Ramp-Up Period is set to “20” seconds, then that means that in 20 seconds all the 10 users will be up and using the application.
  • Formula :
    • Time per user = Ramp-Up Period / No. of Threads i.e. 20 / 10 = 2 (seconds)
    • Each user will take 2s to start
  • Loop Count: It is the number of times loop needs to execute. For example if “Number of users” = 10 and “Loop count” = 2 then 10 users will hit the application twice. Hence, the total load on the application would be of 20 users, 10 users hitting in 2 sets.
  • Scheduler: This feature is used to schedule test execution. When the check box is selected then Scheduler Configuration panel gets enabled.

⇒ Scheduler Configuration

Below configurations can be changed

  • Duration (seconds): JMeter will run the test for the duration specified in this field irrespective of the number of Thread Group in JMeter, loop count etc. For example: If the Duration is set as the 30s then JMeter will end the test after 30s from start of the test run.
  • Startup delay (seconds): JMeter will wait for a specified time before starting the test run based on the value specified in this field.For example: If value 5s is specified then, JMeter will wait for 5s before starting simulating users.
  • Start Time: If JMeter is running, then test run will start at the scheduled time in this field. Format for specifying end time is YYYY/MM/DD HH: MM: SS
  • End Time: JMeter ends the test run as soon as end time is reached. Format for specifying end time is YYYY/MM/DD HH: MM: SS

About the author

Ankita Dawar author

Ankita has worked on different types of testing like Manual, Automation, Performance testing.  She likes to learn about new tools in market that help to make testing easier and interesting. Testing is her passion due to versatile areas it offers.

Leave a Reply

Your email address will not be published.