简体   繁体   中英

How to control frequency in jmeter ultimate thread group

I'm using Ultimate Thread Group in JMeter for a simple Script which includes some requests to emulate the login flow.

Tests will be run in Non-GUI modes. The script looks like that:

  1. Think time - dynamic value [3-5] seconds
  2. Login
  3. Think time - dynamic value [3-5] seconds
  4. Get token
  5. Think time - dynamic value [3-5] minutes (to emulate the user session)
  6. Log out

The total number of threads in the Ultimate Thread Group will be 250. Initial delay=0 Startup Time=250 Hold Load= 400 seconds Shutdown time= 250

I have questions have to do with Ultimate Thread Group and client frequency

Ultimate Thread Group

  1. Can I suppose that Jmeter will add 1 user per second till we got 250 users?
  2. Then taking into account the dynamic think times, can I expect server throughput the maximum as server can reply?
  3. We will have ~ 250 concurrent requests per second from the client-side like the throughput from the client-side?? I'm afraid that I can spam server too much..

The client throughput

Can I use Constant Throughput Timer (CTT) for example if I will need to control throughput from the client-side? For example, I have the requirement - login flow 250 concurrent users, server throughput should be able to process ~ 5 requests per second.

So in case of CTT using, should I remove all think times (except one - 2-3 minutes to emulate the user session) from the script and put only one CTT at the end of the script?

And my final settings will be:

The total number of threads in the Ultimate Thread Group will be 250. Initial delay=0 Startup Time=250 Hold Load= 400 seconds Shutdown time= 250

How to configure CTT to make a load from the client-side 2 requests per second and considering 250 concurrent users?

With your setup

  1. Yes, the Ultimate thread group will add 1 user per second till you get 250 users.
  2. No, since you are using a think time (Hope it's the Uniform Random Timer) you will not get the maximum possible hits from JMeter to your server
  3. No, as mentioned earlier, since you have the think time between 3 - 5 seconds, you will not experience an RPS of 250. but if you remove the think time without adding a timer to control throughput, it's possible to get a higher throughput ( sometimes even more than 250 )

As you have planned, you can use the Constant Throughput Timer (in that case you can remove the think time). But for this case, if you have a request to have 2 requests per second, I recommend you to use the jp@gc - Throughput Shaping Timer . Because for some reason, it seems to work better with the ultimate thread group.

Just to give you some inputs, I created a similar scenario in JMeter, please check the images bellow

In this sample

Start Threads: 25, Initial delay: 0, Startup Time: 25,Hold Load: 10, Shutdown time: 25

在此处输入图像描述

In execution, if you check the jp@gc - Active Threads Over Time graph, it will look like this

在此处输入图像描述

This is your RPS ( Throughput ) when you add a think time

在此处输入图像描述

If you remove the think time and if you did not have a timer to control throughput this is your RPS ( As you can see, even I have 25 threads, the RPS can go passing 25 )

在此处输入图像描述

But when you remove the think time and add a Timer ( I have added the timer to have a start and end RPS as 2 for 60s ) to control throughput will look like this. As you can see, at any given time, the throughput will not exceed 2. 在此处输入图像描述

And If you add both the timer (RPS 2 for the 60s) and think the time the RPS will look like this. In this graph, you will see there are some scenarios where the RPS is more than 2. That happens due to the think time. ( If the previous request have a Think time of 5s and new two have a 3s ) This can happen. but it will not harm the test. 在此处输入图像描述

so in your plan, you add

  • The total number of threads in the Ultimate Thread Group will be 250. Initial delay=0 Startup Time=250 Hold Load= 400 seconds Shutdown time= 250
  • Throughput shaping timer or CTT to control the expected throughput
  • Keep the think time to create a more realistic behaviour ( optional )

Note: you can always use dummy samplers and try out to check if you meed the expected outcome of your plan.

Hope this helps. Cheers

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM