在ab(Apache Benchmark)“失败”中,“接收”和“例外”是指什么?

从ab得到这个结果:

并发级别:10000

testing时间:69.153秒

完成请求:30000

失败的请求:10379

(连接:0, 接收:3424 ,长度:3531, 例外:3424

写错误:0

传输总数:48414203字节

HTML传输:41042477字节

每秒请求数:433.82

[#/秒](平均值)

接收和例外是什么意思? 谢谢。

http://httpd.apache.org/docs/2.2/programs/ab.html

Failed requests The number of requests that were considered a failure. If the number is greater than zero,another line will be printed showing the numer of requests that failed due to connecting, reading, incorrect content length, or exceptions. 

如果您正在testing“dynamic”页面,则内容长度将会改变,并可能导致失败。 示例是广告或图片或页面上不同的结果。

例外,即时猜测,只是在页面上的应用程序抛出的exception。

您的失败率可能很高,因为您的后端应用程序可能无法承受负载或连接。

更新:从ab源代码,接收(err_recv计数)的手段

 /* catch legitimate fatal apr_socket_recv errors */ else if (status != APR_SUCCESS) { err_recv++; if (recverrok) { bad++; close_connection(c); if (verbosity >= 1) { char buf[120]; fprintf(stderr,"%s: %s (%d)\n", "apr_socket_recv", apr_strerror(status, buf, sizeof buf), status); } return; 

这基本上意味着,您的apache / webserver与ab​​发送的数据包有问题。 这可能是因为许多事情 – networking,Apache太忙…当你运行testing,你看到在Apache / Web服务器日志中的任何错误? 具体来说,连接重置或超时?