How should I calculate Ramp-up time in Jmeter

前端 未结 3 1620
走了就别回头了
走了就别回头了 2020-11-29 12:08

There are many questions/answers available here to understand Ramp up time but I want to get something in detail for my test case.

Test Case

相关标签:
3条回答
  • 2020-11-29 12:29

    You should use the Ultimate Thread Group plugins available in Standard set. To maintain concurrency the configuration should be like this:

    Start Thread Count: 1200
    Initial delay, sec: 0
    Startup, sec: 60
    Hold Load: 180
    Shutdown Time, sec: 60
    

    Ultimate Thread Group

    Here all the 1200 threads will be generated and up within 60 sec of Startup time(Ramp up time) .Those 1200 threads will be active for next 180 sec, and after that, those threads will shut down within next 60 sec.

    So overall duration of the test is 300 sec as you desire. Throughout the Hold Load time(180sec) the requests will be looped. This ultimate thread group will give you more control over Threads.

    Now if you want to control the rate of transactions per second or the number of samples to execute you can use Constant Throughput Timer. Constant Throughput Timer will let you control the flow of requests to be sent. The default "Thread Group" only control the way the users or threads will be generated.It doesn't control the rate of requests to be hit your application.So for this purpose, you could use "Constant Throughput Timer" to control your requests per second. For further detail, you could go through JMeter documentation.

    0 讨论(0)
  • 2020-11-29 12:32

    Rampup is the speed at which users arrive on your application. The number you put means that once it is reached all threads have been started. The tiniest it is , the faster users arrive. So nobody can answer that for you, you need to analyse your traffic.

    Regarding the number of threads, 1200 threads might not be the good number, as 1200 users can navigate on application slowly or rapidly. What you need is add a Constant Throughput Timer to control how much transactions per second you'll be reaching.

    0 讨论(0)
  • 2020-11-29 12:46

    As per you test case and duration settings, I think, you are making confusion with the Threads and Requests.

    In short: You must use Ramp-up as 240 seconds for this scenario.

    Let me describe you in details:

    Ramp up is the time in which all the users arrive on your tested application server.

    Requests are simulated by samplers but threads are the simulation of users.

    Please note- The total number of requests are related to throughput, Whereas the number of active threads performing the same activity is related to concurrency.

    From your requirements, I assume you want to measure the throughput which is related to the requests/second not the users per second. To achieve this, you can use a Constant Throughput Timer at your test plan level.

    Constant Throughput timer allows you maintain throughput of your server (requests/sec). Here requests are samplers. Threads are users/clients which are requesting server using samplers.

    You can achieve this by using both "Thread Group" or "Ultimate Thread Group".

    As far as I know, it doesn't matter which type of Thread group you are using with Constant Throughput timer, at the end of the test in the results, you will get your desired Throughput which you mentioned in Constant Throughput Timer i.e. if you have mentioned 1200/min in Constant Throughput Timer with "Calculate Throughput based on" value as "All active threads" and there are 3 requests (samplers) in your thread group then JMeter will manage the requests in a way that it will generate only 6.6 requests/sec for each sampler i.e. 1200/min is divided among 3 requests, it doesn't matter whether you are using Ultimate Thread Group or the Thread Group; Throughput timer works in same way for all types of thread groups.

    Now as per your requirement: (Using Thread Group):

    No. of Threads : 1200
    
    Ramp-up Time - 240 (Since you want 5 users per second, 1200/5= 240)
    
    Loop count - Forever
    
    Scheduler (Duration) - 780 Seconds [13 Minutes]
    

    IMPORTANT:

    Thread Group configurations will be the same which you have already mentioned. Number of threads will be the client load which you want to put(in you case it's 1200), duration : (240+300+240), loop : forever, ramp-up : 240 yes when you ramp up i.e. in the first minute generally you get more requests as threads are starting so it is normal behavior. To test your scenario run for exactly 5 minutes, you should test for 13 minutes. Exclude first 4 min and last 4 min of the test as that is warm up time for your test as well as server and last 4 min are warm down period.

    Now as per your requirement: (Using Ultimate Thread Group):

    Start Thread Count: 1200
    Initial delay, sec: 0
    Startup, sec: 240 (I assume you want 5 users come to your application for requesting expected samples per second)
    Hold Load for: 300 sec (Since you required 5 minutes to test for 1200 users)
    Shutdown Time, sec: 240
    

    You can set just like this:

    Don't get confuse the Thread number with the number of requests, each thread will create multiple requests for seconds in field Hold Load for.

    0 讨论(0)
提交回复
热议问题