JMeter:常量吞吐量计时器未按预期工作

时间:2018-06-14 02:51:46

标签: jmeter load-testing jmeter-4.0

我有一个用200个线程定义的单个线程组。我在线程组中定义了HTTP请求,在HTTP请求中定义了一个常量吞吐量计时器。定义的目标吞吐量(样本/分钟)是5400个样本/分钟(因为我希望实现90个请求/秒的吞吐量)。

我在非GUI模式下运行测试。这是我看到的摘要报告:

Creating summariser <summary>
Created the tree successfully using Elasticsearch_Backup.jmx
Starting the test @ Thu Jun 14 02:38:44 UTC 2018 (1528943924375)
Waiting for possible Shutdown/StopTestNow/Heapdump message on port 4445
summary +    187 in 00:00:46 =    4.1/s Avg: 34306 Min:     4 Max: 45427 Err:    13 (6.95%) Active: 200 Started: 200 Finished: 0
summary +    532 in 00:00:29 =   18.2/s Avg: 14309 Min:     3 Max: 53467 Err:     6 (1.13%) Active: 200 Started: 200 Finished: 0
summary =    719 in 00:01:15 =    9.6/s Avg: 19510 Min:     3 Max: 53467 Err:    19 (2.64%)
summary +   1318 in 00:00:30 =   43.8/s Avg:  4949 Min:     2 Max: 13973 Err:    10 (0.76%) Active: 200 Started: 200 Finished: 0
summary =   2037 in 00:01:45 =   19.4/s Avg: 10089 Min:     2 Max: 53467 Err:    29 (1.42%)
summary +    410 in 00:00:31 =   13.4/s Avg: 11060 Min:     4 Max: 27259 Err:     5 (1.22%) Active: 200 Started: 200 Finished: 0
summary =   2447 in 00:02:16 =   18.0/s Avg: 10251 Min:     2 Max: 53467 Err:    34 (1.39%)
summary +    300 in 00:01:00 =    5.0/s Avg: 23086 Min:     3 Max: 76712 Err:     4 (1.33%) Active: 200 Started: 200 Finished: 0
summary =   2747 in 00:03:16 =   14.0/s Avg: 11653 Min:     2 Max: 76712 Err:    38 (1.38%)
summary +     95 in 00:00:31 =    3.0/s Avg: 57490 Min:     3 Max: 93311 Err:     1 (1.05%) Active: 200 Started: 200 Finished: 0
summary =   2842 in 00:03:47 =   12.5/s Avg: 13185 Min:     2 Max: 93311 Err:    39 (1.37%)
summary +     84 in 00:00:28 =    3.0/s Avg: 76465 Min: 57500 Max: 119520 Err:     0 (0.00%) Active: 200 Started: 200 Finished: 0
summary =   2926 in 00:04:15 =   11.5/s Avg: 15002 Min:     2 Max: 119520 Err:    39 (1.33%)
summary +     98 in 00:00:30 =    3.3/s Avg: 62451 Min: 18075 Max: 121665 Err:     0 (0.00%) Active: 200 Started: 200 Finished: 0
summary =   3024 in 00:04:45 =   10.6/s Avg: 16539 Min:     2 Max: 121665 Err:    39 (1.29%)
summary +    204 in 00:00:30 =    6.8/s Avg: 47297 Min:  8554 Max: 152392 Err:     2 (0.98%) Active: 200 Started: 200 Finished: 0
summary =   3228 in 00:05:15 =   10.2/s Avg: 18483 Min:     2 Max: 152392 Err:    41 (1.27%)
summary +    723 in 00:00:30 =   24.1/s Avg: 10706 Min:     4 Max: 161663 Err:     2 (0.28%) Active: 200 Started: 200 Finished: 0
summary =   3951 in 00:05:45 =   11.4/s Avg: 17060 Min:     2 Max: 161663 Err:    43 (1.09%)
summary +   1089 in 00:00:30 =   36.2/s Avg:  5725 Min:     3 Max: 159356 Err:     3 (0.28%) Active: 200 Started: 200 Finished: 0
summary =   5040 in 00:06:15 =   13.4/s Avg: 14611 Min:     2 Max: 161663 Err:    46 (0.91%)

我看不到请求/秒超过43.我的配置有问题吗?

1 个答案:

答案 0 :(得分:0)

Constant Throughput Timer只能暂停主题,以便将JMeter的吞吐量限制到定义的值。根据文档&gt;

  

当然,如果服务器无法处理,或者其他计时器或耗时的测试元素阻止吞吐量,则吞吐量会降低

查看平均响应时间,可以高达&gt; 1分钟我的期望是您的服务器根本无法快速响应,因此由于某种形式的bottleneck而无法达到所需的吞吐量。

如果预计响应时间很长 - 您可以尝试增加Thread Group中的线程数,或者更好地切换到Concurrency Thread GroupThroughput Shaping Timer组合。这两个测试元素可以通过feedback function耦合,因此如果当前数量不足以达到/维持所需的吞吐量,JMeter将自动启动更多线程。您可以使用JMeter Plugins Manager

安装这两个元素