了解蝗虫摘要结果

Understanding locust summary result

我无法理解 Locust 结果,因为这是第一次对我的服务器进行负载测试,我 运行 Locust 在 00:00 当地时间使用命令行; 1000 个用户,每秒 100 个孵化器和 10000 个请求。以下是结果

Name                                                          # reqs      # fails     Avg     Min     Max  |  Median   req/s
--------------------------------------------------------------------------------------------------------------------------------------------
GET /api/v0/business/result/22918                                452  203(30.99%)    9980    2830   49809  |    6500    1.70
GET /api/v0/business/result/36150                                463  229(33.09%)   10636    2898   86221  |    7000    1.50
GET /api/v0/business/result/55327                                482  190(28.27%)   10401    3007   48228  |    7000    1.60
GET /api/v0/business/result/69274                                502  203(28.79%)    9882    2903   48435  |    6800    1.50
GET /api/v0/business/result/71704                                469  191(28.94%)   10714    2748   62271  |    6900    1.70
POST /api/v0/business/query                                    2268  974(30.04%)   10528    2938   55204  |    7100    7.10
GET /api/v0/suggestions/query/?q=na                            2361 1013(30.02%)   10775    2713   63359  |    6800    7.80
--------------------------------------------------------------------------------------------------------------------------------------------
Total                                                           6997 3003(42.92%)                                      22.90

Percentage of the requests completed within given times
Name                                                           # reqs    50%    66%    75%    80%    90%    95%    98%    99%   100%
--------------------------------------------------------------------------------------------------------------------------------------------
GET /api/v0/business/result/22918                                 452   6500   8300  11000  13000  20000  35000  37000  38000  49809
GET /api/v0/business/result/36150                                 463   7000   9400  12000  14000  21000  35000  37000  38000  86221
GET /api/v0/business/result/55327                                 482   7000   9800  12000  13000  21000  34000  38000  39000  48228
GET /api/v0/business/result/69274                                 502   6800   9000  11000  12000  20000  35000  37000  38000  48435
GET /api/v0/business/result/71704                                 469   6900   9500  11000  13000  21000  36000  38000  40000  62271
POST /api/v0/business/query                                     2268   7100   9600  12000  13000  21000  35000  37000  38000  55204
GET /api/v0/suggestions/query/?q=na                             2361   6800   9900  12000  14000  22000  35000  37000  39000  63359
--------------------------------------------------------------------------------------------------------------------------------------------

Error report
# occurences       Error                                                                                               
--------------------------------------------------------------------------------------------------------------------------------------------
80                 GET /api/v0/business/result/71704: "HTTPError('502 Server Error: Bad Gateway',)"                    
111                GET /api/v0/business/result/71704: "HTTPError('504 Server Error: Gateway Time-out',)"               
134                GET /api/v0/business/result/22918: "HTTPError('504 Server Error: Gateway Time-out',)"               
69                 GET /api/v0/business/result/22918: "HTTPError('502 Server Error: Bad Gateway',)"                    
92                 GET /api/v0/business/result/69274: "HTTPError('502 Server Error: Bad Gateway',)"                    
594                GET /api/v0/suggestions/query/?q=na: "HTTPError('504 Server Error: Gateway Time-out',)"            
111                GET /api/v0/business/result/69274: "HTTPError('504 Server Error: Gateway Time-out',)"               
419                GET /api/v0/suggestions/query/?q=na: "HTTPError('502 Server Error: Bad Gateway',)"                 
69                 GET /api/v0/business/result/55327: "HTTPError('502 Server Error: Bad Gateway',)"                    
121                GET /api/v0/business/result/55327: "HTTPError('504 Server Error: Gateway Time-out',)"               
397                POST /api/v0/business/query: "HTTPError('502 Server Error: Bad Gateway',)"                         
145                GET /api/v0/business/result/36150: "HTTPError('504 Server Error: Gateway Time-out',)"               
577                POST /api/v0/business/query: "HTTPError('504 Server Error: Gateway Time-out',)"                    
84                 GET /api/v0/business/result/36150: "HTTPError('502 Server Error: Bad Gateway',)"                    
--------------------------------------------------------------------------------------------------------------------------------------------

这是我困惑的地方:

  1. #reqs、#fails、Avg 下面的数字以及第一名和第二名名字后面的所有数字是什么意思 table?是显示发送了总请求还是发送了第n个请求?
  2. 在出现 # 次以下的错误报告中,总数是否表示导致错误的请求数?

感谢您的回答

首先 table 以毫秒为单位显示与给定列解释的每一行相关的统计信息,但 total raw 显示每个给定列的总数。但是,在您的示例中,每个原始数据的失败百分比计算存在问题。对于第一个原始数据:发送了 452 个请求,但其中 203 个请求失败,这意味着 203/453 ~= 44.81% 但在原始数据总数中它是正确计算的。

第二个 table 是分布 table,它显示给定时间间隔的请求完成百分比,在 table 中表示到主页的总请求的 50% 在 6500 毫秒内完成和 66% 的请求在 8300 毫秒内完成并分别继续。