在负载平衡的Tornado站点上使用apache基准测试获取失败的请求,但未记录任何请求 [英] Getting failed requests with apache benchmark on a load balanced Tornado site but none logged

查看:54
本文介绍了在负载平衡的Tornado站点上使用apache基准测试获取失败的请求,但未记录任何请求的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

也许这是一个关于ab的问题,而不是关于Tornado的问题,但是这没有任何意义.

Perhaps this is a question about ab rather than about Tornado but something doesn't make sense.

我这样运行基准测试:

$ ab -n 100 http://localdomainname/ # 2 tornados being 1 nginx
 ...
Concurrency Level:      1
Time taken for tests:   0.162 seconds
Complete requests:      100
Failed requests:        17
   (Connect: 0, Receive: 0, Length: 17, Exceptions: 0)
Write errors:           0

因此,根据100个请求中的17个失败.

So according to that 17 of 100 requests failed.

在运行基准测试之前,我重置了日志文件并再次查看它们:

Prior to running the benchamark I reset the log files and look at them again:

$ wc -l /tmp/gkc.access.log 
100 /tmp/gkc.access.log
$ cat /tmp/gkc.access.log | grep ' 200 ' | wc -l
100

因此,据Nginx称,没有请求失败!为什么Ab说100中的17失败了?

So, according to Nginx no requests failed! Why is ab saying 17 of 100 failed?

(顺便说一句,每100个中有17个只是一个例子.它会上下波动,但从不希望达到0)

(By the way, 17 out of 100 was just one example. it goes up and down but never 0 which I'd expect)

更新

已经使用httperf进行了测试,而没有涉及Tornado + Nginx设置,我收到了0个失败的请求.

Having tested with httperf without touching the Tornado+Nginx setup I get 0 failed requests.

推荐答案

您收到长度"失败的请求,这并不意味着响应代码不是200.这仅意味着跨请求的响应时间长度是不同的(它记得第一个的长度).

You get the "length" failed requests, which does not mean that the response code was not 200. It just means that the length of response across requests was different (it remembers the length of the first one).

此问题已详细讨论了此问题:负载测试AB ...伪造的失败请求(长度)

In detail this issue has been discussed in this question: Load Testing with AB ... fake failed requests (length)

这篇关于在负载平衡的Tornado站点上使用apache基准测试获取失败的请求,但未记录任何请求的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆