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

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

问题描述

这里有很多问题/答案可以理解Ramp up time,但是我想详细介绍一下我的测试用例.

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

测试用例:主页上每5分钟预计有1200个用户.这样就好像是5个用户/秒.

Test Case : Expecting 1200 users per 5 minutes on the home page. So it will be like 5 users/second.

我设置了以下thread properties:

No. of Threads : 1200

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

Loop count - Forever

Scheduler - 300 Seconds[5 Minutes]

有人可以帮助我为我的测试用例设置ramp up time吗?我正在本地计算机上运行测试.

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

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

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.

简而言之:在这种情况下,您必须将Ramp-up用作 240 seconds .

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

让我详细描述您:

升级是所有用户到达测试的应用程序服务器的时间.

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.

恒定吞吐量计时器可让您保持服务器的吞吐量(requests/sec).这里的请求采样器. 线程是使用采样器请求服务器的用户/客户端.

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.

您可以同时使用"Thread Group" "Ultimate Thread Group" .

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

据我所知,使用恒定吞吐量计时器使用哪种类型的线程组都没关系,在测试结束时,您将获得所需的吞吐量您在恒定吞吐量计时器"中提到的,即,如果您在恒定吞吐量计时器"中提到 1200/min ,并且将基于" 值计算为所有活动线程" ,并且您的线程组中有3个请求(采样器),然后JMeter将以仅对每个采样器生成 6.6请求/秒的方式来管理请求,即1200/min被除以在3个请求中,无论您使用的是最终线程组还是线程组;吞吐量计时器对所有类型的线程组都以相同的方式工作.

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.

现在根据您的要求:(使用线程组):

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]

重要提示:

线程组配置将与您已经提到的相同.线程数将是您要放置的客户端负载(in you case it's 1200),duration : (240+300+240)loop : foreverramp-up : 240是的,是,当您加速时,即通常在第一分钟,随着线程启动,您会收到更多请求,因此这是正常行为. 要测试您的方案是否可以准确运行5分钟,您应该测试13 minutes.排除测试的前4分钟和最后一个4 min,因为这是测试的预热时间,而服务器和最后一个4 min是预热时间.

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.

现在根据您的要求:(使用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

您可以这样设置:

不要混淆线程号请求的数量,每个线程将在字段保持加载中创建多个请求,时间为秒>.

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天全站免登陆