Ab显示失败的请求(长度)

时间:2019-05-07 12:05:25

标签: apachebench

如何使用keep-alive解决apachebench中失败的长度请求?

我正在使用带有保持活动状态的ab工具测试剩余服务,摘要显示一半的请求由于长度而失败。

如果我在没有kepp-alive的情况下对其进行测试,则表明所有请求均已成功,但吞吐量降低到前一个请求的3/4。

用于通过keep-alive运行测试的命令:

`ab -t 120 -n 2 -c 1 -p postfile.txt -T application/json -k http://localhost:8001/profile`

摘要:

`Concurrency Level:      1
Time taken for tests:   0.005 seconds
Complete requests:      2
Failed requests:        1
   (Connect: 0, Receive: 0, Length: 1, Exceptions: 0)
Keep-Alive requests:    1
Total transferred:      1012 bytes
Total body sent:        1908
HTML transferred:       607 bytes
Requests per second:    424.27 [#/sec] (mean)
Time per request:       2.357 [ms] (mean)
Time per request:       2.357 [ms] (mean, across all concurrent requests)
Transfer rate:          209.65 [Kbytes/sec] received
                        395.27 kb/s sent
                        604.91 kb/s total`

用于在没有保持活动状态的情况下运行测试的命令:

`ab -t 120 -n 2 -c 1 -p postfile.txt -T application/json -k http://localhost:8001/profile`

摘要:

`Concurrency Level:      1
Time taken for tests:   0.009 seconds
Complete requests:      2
Failed requests:        0
Total transferred:      1976 bytes
Total body sent:        1860
HTML transferred:       1214 bytes
Requests per second:    223.64 [#/sec] (mean)
Time per request:       4.471 [ms] (mean)
Time per request:       4.471 [ms] (mean, across all concurrent requests)
Transfer rate:          215.78 [Kbytes/sec] received
                        203.11 kb/s sent
                        418.89 kb/s total`

我在终点启用了日志打印。然后我看到只打印了一个日志,而不是2。这意味着只有一半的请求到达了终点。选项-l只是从摘要中隐藏故障,即,使用-l选项时,我只能看到一张日志。

我希望所有请求都应得到处理。如何解决这个问题?如果使用选项-v 5,则看不到失败的正确原因。 Atleast如何查看失败的原因是什么?

0 个答案:

没有答案