2
votes

I am using Jmeter 4.0 with Throughput Shaping Timer and I have mentioned my configuration as follows:

bzm - Concurrency Thread Group:

  • Target Concurrency 1000
  • ramp up time : 1
  • ramp up steps: 1
  • Hold Target Rate: 100 min

jp@gc - Throughput Shaping Timer Start RPS: 333 || End Rps: 333 || Duration(sec): 1200

Since the test duration is mentioned as 1200 seconds and Rps is 333/sec so number of request hits through the test should be (333*1200) = 399600. But actual number of hits coming in range of 400000 - 410000 Requests per second.

How can Throughput Shaping Timer be restricted to not send extra requests?

2
That's because test is not finished on exactly 1200th second. From JMeter results output check the time to finish the test. Also try to add more ramp up time. Ramping up 1000 threads within 1 second is not feasibleAdnan

2 Answers

1
votes

Your Total test duration isn't 1200 seconds. Looking into your Concurrency Thread Group Configurations, your test duration is exactly 6001 seconds (Ramp up for 1000 user is 1 sec and the Hold Target Rate time is 6000 seconds).

To get your desired RPS, You have to follow the below formula to define the number of threads in Concurrency Thread Groups:

Threads pool size can be calculated like RPS * <max response time> / 1000

If your response time is 1 second, then 333 Threads are enough to achieve this RPS. You have used more threads in this case I guess.

According to your given test plan, it is working like 1000 users are active in 1 second and then they will try to achieve 333 RPS for 1200 seconds and then they will maintain 1000 users requests for remaining time (6001-1220=4801 seconds) as you mentioned 1000 users will hold the load for 100 mins. For this reason, you are getting extra requests than desired.

So, Define number of threads and ramp up time accordingly in your Thread groups and also sync your test duration properly (in this case hold load time could be 20 mins not 100 mins).

0
votes

JMeter is not capable of immediately stopping 1000 threads when the Throughput Shaping Timer reaches its duration limit, JMeter "tells" threads to stop one 1200 seconds pass and it might take a while to gracefully shut the threads down.

Given your setup the only way of having exactly 399600 samplers is using Throughput Controller in Total Executions mode like:

enter image description here

This way you will get confidence that not more than 339600 samplers will be executed (the number can be less by the way if your application response time will be higher than 300 ms)