0
votes

I want to execute a test with only 1 thread group. I want to run n different threads. Say the test would take 1 second, then I could set threads = n and ramp up = 1, loop = 1. My thinking was that if I wanted the test to run longer, I should just raise the number of ramp up seconds AND raise the number of loops by the same ratio. I got that idea reading here:

http://www.testingjournals.com/5-must-know-features-thread-group-jmeter/

In the loop section under scenario 2 it says: Every 5 seconds (100/20) 4 Thread / Requests will hit the server.

But I didn't understand if it means that 4 threads are evenly spread over 5 seconds, or that every 5 seconds 4 requests will be shot at once.

What if I want to test this exact same test but for longer periods of time? I don't want more threads since every thread has a connection overhead. So I want the same n threads to be run evenly distributed over a second, for a growing number of seconds. How can I assure that the same threads will be used AND will be evenly distributed over what ever time frame I wish? Should I use the constant throughput timer? And if so, what should be set in the loop and ramp up configurations?

2

2 Answers

1
votes

If your goal is to execute X requests per second - go for one of the following test elements:

All above can pause JMeter threads in order to limit the throughput (requests per unit of time) to the given number. With regards to setting up Thread Group:

  • Number of threads: it should be enough in order to reach the target throughput. In case of Throughput Shaping Timer you can use Concurrency Thread Group and connect them via feedback function - in this case JMeter will be able to kick off extra threads automatically if current amount is not enough to reach/maintain the desired number of requests per second
  • Loops: tick forever
  • You can set the desired test duration using Scheduler Configuration -> Duration (seconds) in the Thread Group.
0
votes

Let see the Scenario

– Scenario 2 : Thread Count = 20, Ramp Up Time (Seconds) = 100 & Loop Count = 4 Every 5 seconds (100/20) 4 Thread / Requests will hit the server. Once the first thread completes the first round of execution, it will start 2nd loop by executing same HTTP request. Execution lasts until all 20 threads executes all HTTP requests 4 times.

There are total 20 threads and the threads will be executed evenly over 100 seconds

Meaning 100/20 = 5 seconds interval until between thread creation

Notice that loop count = 4 then it'll execute requests inside each thread 4 times

Notice that the timing is approximately and not accurate

So Ramp up period is suitable for not creating evenly distributed new threads.

For more controlled executing see JMeter plugin's UltimateThreadGroup

"Ultimate" means there will be no need in further Thread Group plugins. The features that everyone needed in JMeter and they finally available:

  • infinite number of schedule records

  • separate ramp-up time, shutdown time, flight time for each schedule record

  • and, of course, trustworthy load preview graph