Jmeter Throughput Shaping Timer sending more requests then desired

心不动则不痛 提交于 2019-12-24 13:50:31

问题


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?


回答1:


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).




回答2:


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:

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)



来源:https://stackoverflow.com/questions/55096221/jmeter-throughput-shaping-timer-sending-more-requests-then-desired

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!