简体   繁体   English

吞吐量值是否与JMeter中请求的响应时间有关?

[英]Is the throughput value related to the response time of requests in JMeter?

I'm getting the following results, where the throughput does not have a change, even when I increase the number of threads. 我得到以下结果,即使增加线程数,吞吐量也没有变化。

Scenario#1: 方案1:

Number of threads: 10 线程数:10

Ramp-up period: 60 准备阶段:60

Throughput: 5.8/s 吞吐率:5.8 / s

Avg: 4025 平均:4025

Scenario#2: 情景2:

Number of threads: 20 线程数:20

Ramp-up period: 60 准备阶段:60

Throughput: 7.8/s 吞吐率:7.8 / s

Avg: 5098 平均:5098

Scenario#3: 情景3:

Number of threads: 40 线程数:40

Ramp-up period: 60 准备阶段:60

Throughput: 6.8/s 吞吐率:6.8 / s

Avg: 4098 平均:4098

The my JMeter file consists of a single ThreadGroup that contains a single GET. 我的JMeter文件由一个包含单个GET的ThreadGroup组成。

When I perform the request for an endpoit where the response time faster (less than 300 ms) I can achieve throughput greater than 50 requests per seconds. 当我执行响应速度更快(小于300毫秒)的端对端请求时,我可以获得的吞吐量大于每秒50个请求。

Can you see the bottleneck of this? 您能看到这个瓶颈吗?

Is there a relationship between response time and throughput? 响应时间和吞吐量之间有关系吗?

In ideal world if you increase number of threads by factor of 2x - throughput should increase by the same factor. 在理想情况下,如果将线程数增加2倍,则吞吐量应增加相同的倍数。

In reality the "ideal" scenario is hardly achievable so it looks like a bottleneck in your application. 实际上,“理想”方案是无法实现的,因此它看起来像是应用程序中的瓶颈。 The process of identifying the bottleneck normally looks as follows: 识别瓶颈的过程通常如下所示:

  • Amend your test configuration to increase the load gradually so ie start with 1 virtual user and increase the load to ie 100 virtual users in 5 minutes 修改测试配置以逐渐增加负载,即从1个虚拟用户开始,并在5分钟内将负载增加到100个虚拟用户
  • Run your test and look into Active Threads Over Time , Response Times Over Time and Server Hits Per Second listeners. 运行您的测试,并查看随时间变化的活动线程,随时间变化的 响应时间每秒服务器点击数的侦听器。 This way you will be able to correlate increasing load with increasing response time and identify the point where performance starts degrading. 这样,您就可以将增加的负载与增加的响应时间相关联,并确定性能开始下降的点。 See What is the Relationship Between Users and Hits Per Second? 请参阅用户与每秒点击数之间的关系是什么? for more information 欲获得更多信息
  • Once you figure out what is the saturation point you need to know what prevents your application from from serving more requests, the reasons could be in: 一旦确定了饱和点 ,就需要知道是什么阻止了您的应用程序处理更多请求,其原因可能是:

    • Application simply lacks resources (CPU, RAM, Network, Disk, etc.), make sure to monitor the aforementioned resources, this could be done using ie JMeter PerfMon Plugin 应用程序只是缺少资源(CPU,RAM,网络,磁盘等),请确保监视上述资源,这可以使用JMeter PerfMon插件来完成
    • The infrastructure configuration is not suitable for high loads (ie application or database thread pool settings incorrect) 基础结构配置不适合高负载(即应用程序或数据库线程池设置不正确)
    • The problem is in your application code (inefficient algorithm, large objects, slow DB queries). 问题出在您的应用程序代码中(效率低下的算法,大对象,数据库查询缓慢)。 These items can be fetched using a profiler tool 可以使用探查器工具提取这些项目
    • Also make sure you're following JMeter Best Practices as it might be the case JMeter is not capable of sending requests fast enough due to either lack of resources on JMeter load generator side or incorrect JMeter configuration (too low heap, running test in GUI mode, using listeners, etc) 还要确保您遵循JMeter最佳实践 ,因为由于JMeter负载生成器方面的资源不足或JMeter配置不正确(堆太低,在GUI模式下运行测试),JMeter不能足够快地发送请求,使用侦听器等)

It's simple as JMeter user manual states: 正如JMeter用户手册所述,这很简单:

Throughput = (number of requests) / (total time) 吞吐量=(请求数)/(总时间)

Now assuming your test contains only a single GET then Throughput will be correlate average response time of your requests. 现在假设您的测试包含一个GET,那么吞吐量将与您请求的平均响应时间相关。

Notice Ramp-up period: 60 will start to create threads over 1 minute, so it will add to total time of execution, you can try to reduce it to 10 or equal to Number of threads. 注意加速期:60将在1分钟内开始创建线程,因此它将增加总的执行时间,您可以尝试将其减少到10或等于线程数。

But you may have other sampler/controllers/component that may effect total time. 但是您可能还有其他采样器/控制器/组件可能会影响总时间。

Also in your case especially in Scenario 3, maybe some requests failed then you are not calculating Throughput of successful transactions. 同样在您的情况下,尤其是在方案3中,也许某些请求失败了,那么您就没有在计算成功事务的吞吐量。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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