我应该如何计算 Jmeter 的加速时间 [英] How should I calculate Ramp-up time in Jmeter

查看:26
本文介绍了我应该如何计算 Jmeter 的加速时间的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

这里有很多问题/答案可以帮助您了解加速时间,但我想了解我的测试用例的详细信息.

测试用例:主页上预计每 5 分钟有 1200 个用户.所以它将是 5 个用户/秒.

我设置了以下线程属性:

没有.线程数:1200加速时间 - ?[我不知道该设置什么]循环计数 - 永远调度程序 - 300 秒 [5 分钟]

谁能帮我为我的测试用例设置ramp up time?我正在本地机器上运行测试.

我想检查一下服务器在 5 分钟内可以处理多少用户.我们的期望是 1200 个用户.

解决方案

根据您的 测试用例持续时间 设置,我认为您对 线程和请求.

简而言之:对于这种情况,您必须将加速用作 240 秒.

让我详细描述一下:

加速是所有用户到达您测试的应用服务器的时间.

请求采样器模拟,而线程用户的模拟.

请注意-请求的总数吞吐量有关,而活动线程的数量执行相同的活动与并发有关.

根据您的要求,我假设您想衡量与请求/秒相关的吞吐量,而不是每秒用户数.为此,您可以在测试中使用

不要将线程数请求数混淆,每个线程将在字段Hold Load for中创建多个请求数秒>.

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 : Expecting 1200 users per 5 minutes on the home page. So it will be like 5 users/second.

I have set following thread properties :

No. of Threads : 1200

Ramp-up Time - ? [I am not sure what to set]

Loop count - Forever

Scheduler - 300 Seconds[5 Minutes]

Can anyone please help me to set ramp up time for my test case? I am running the test on my local machine.

I want to check that how many users server can handle in 5 minutes. Our expectation is 1200 users.

解决方案

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.

这篇关于我应该如何计算 Jmeter 的加速时间的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆