Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

# of threads, ramp up period, loop count, scheduler duration in jmeter

Tags:

jmeter

I am new to Jmeter and confused about those 4 settings:

  • number of threads,
  • ramp up period,
  • loop count,
  • duration in scheduler.

    Thread Group 1: # of threads:1, ramp up period:0, loop count:5, no scheduler
    Thread Group 2: # of threads:5, ramp up period:0, loop count:1, no scheduler
    Thread Group 3: # of threads:1, ramp up period:1s, loop count:5, no scheduler
    Thread Group 4: # of threads:5, ramp up period:5s, loop count:1, no scheduler
    Thread Group 5: # of threads:1, ramp up period:1s, loop count:forever, duration in scheduler:5s
    Thread Group 6: # of threads:5, ramp up period:5s, loop count:forever, duration in scheduler:5s
    
    1. Is there any difference between thread group 1 and 2?
    2. How long is the time cap between each loop?
    3. Is there any difference among thread group 3, 4, 5 and 6?
    4. Should group 3, 4, 5 and 6 all take 5 seconds to finish sending all requests? Should the total # of results be 5 in each group?
    5. When I tried thread group 5, I got around 83 responses, why is there not just 5 responses? Does this mean the ramp up period is not working?

I am so confused about the differences between those groups, hoping someone can help me out. Thanks a lot in advance!

like image 750
zhengyu Avatar asked May 10 '13 18:05

zhengyu


2 Answers

Firstly, short definition of each parameter:

  1. Number of Threads: simulates the number of users

  2. Ramp up period : how much time Jmeter takes to get all threads started

  3. Loop count: number of times each thread performs the test case

  4. Duration in scheduler: the duration for which the test is to be run. In this case, the value in the end-time field shall be ignored and the relative end-time will be calculated from the start-time and duration

A important thing to understand here is that the Ramp-up period has no relation to the Loop count. It is only related to the Number of Threads. If there are 10 threads and a ramp-up time of 100 seconds, then each thread will begin 10 seconds after the previous thread started, for a total time of 100 seconds to start all threads in the thread group.

Now the answer to each Thread Group Case:

Thread Group 1: # of threads:1, ramp up period:0, loop count:5, no scheduler
Thread Group 2: # of threads:5, ramp up period:0, loop count:1, no scheduler
Thread Group 3: # of threads:1, ramp up period:1s, loop count:5, no scheduler
Thread Group 4: # of threads:5, ramp up period:5s, loop count:1, no scheduler
Thread Group 5: # of threads:1, ramp up period:1s, loop count:forever, duration in scheduler:5s
Thread Group 6: # of threads:5, ramp up period:5s, loop count:forever, duration in scheduler:5s

Q1. Is there any difference between thread group 1 and 2?

Thread Group 1 has a single thread that will repeat the same test 5 times i.e. as one test finishes repeat the test till a loop count of 5 is reached

Thread Group 2 has 5 threads that will start simultaneously as the Ramp-up Period is 0, so there it shall mock 5 users simultaneously on the system

Q2. How long is the time cap between each loop?

The time cap is a factor of the ramp-up period that is divided equally between the number of threads in the thread group. Loop is a continuous process that shall continue till the loop count is reached. "Time cap" is not a term used in the JMeter docs, but assuming what you mean, it can be set between loops by using Test Action or other JMeter mechanisms if you need fine-grained control.

Q3. Is there any difference among thread group 3, 4, 5 and 6?

Yes, all the parameters are different, so as described above, the behavior is different.

Q4. Should group 3, 4, 5 and 6 all take 5 seconds to finish sending all requests? Should the total # of results be 5 in each group?

No, it is all subjective to each condition. In Thread Group 3, a single thread shall execute the same thread 5 times, so no control over time

In Thread Group 4, there are 5 thread and based on the ramp-up period, each thread shall start 1 s after the other, so it will take at-least 4-5 seconds to complete the test (after the last test)

Thread Group 5 and 6 shall each only run for a duration for 5 seconds. If the test is completed before that then fine, otherwise the test shall be terminated and stopped

Q5. When I tried thread group 5, I got around 83 responses, why is there not just 5 responses? Does this mean the ramp up period is not working?

Why should there be only 5 responses??? Thread Group 5 shall create a single thread that shall execute the test in loop for ever. If the duration was not defined the test would run in an infinite loop. Since the duration is defined, the test shall only run for the duration period.

Note to All: The loop count is thread specific. It specifies the number of times the test should be repeated for each thread. The ramp-up period is related to the #Thread (User) and has no relation to the loop count

like image 187
kapil Avatar answered Sep 30 '22 18:09

kapil


  1. Yes, 1 simulates one user doing 5 times the test scenario inside Thread Group1, 2, simulates 5 users executing test scenario one time
  2. No time if you don't use any Timer
  3. Yes, 3 same as Thread Group 1, 4 same as Thread Group 2 but users are started 1s after each others, 5, same as Thread Group 1 but running for 5 s, so you don't know how many times it will execute. 6 same as Thread Group 2 but runs for 5 s
  4. 5 and 6 will run for 5 s, 3 and 4 as explained in 3. No 5.Because it runs for 5 seconds without any pause as you didn't set any timer. As you have only one thread, it starts immediately and runs for 5 seconds.

Read:

  • http://jmeter.apache.org/usermanual/test_plan.html
like image 20
UBIK LOAD PACK Avatar answered Sep 30 '22 19:09

UBIK LOAD PACK