You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
ab fails to parse CONTENT-LENGTH. From the source code of ab we can see that there is some hand-craft HTTP parser (httpd/support/ab.c:read_connection):
if (keepalive&&
(strstr(c->cbuff, "Keep-Alive")
||strstr(c->cbuff, "keep-alive"))) { /* for benefit of MSIIS */char*cl;
cl=strstr(c->cbuff, "Content-Length:");
/* handle NCSA, which sends Content-length: */if (!cl)
cl=strstr(c->cbuff, "Content-length:");
if (cl) {
c->keepalive=1;
/* response to HEAD doesn't have entity body */c->length=method!=HEAD ? atoi(cl+16) : 0;
}
/* The response may not have a Content-Length header */if (!cl) {
c->keepalive=1;
c->length=0;
}
}
Although it's ab that violates the HTTP standard, considering that ab is a common tool for HTTP benchmarking, the behavior that ab works on other HTTP library and only hangs on aiohttp will frustrate users. Making HTTP headers camel case also have other benefits discussed in #223, #813.
Steps to reproduce
Install aiohttp and ab, and use the above example program and command line.
Your environment
Linux iceboy-m7h 4.6.2-1-ARCH #1 SMP PREEMPT Wed Jun 8 08:40:59 CEST 2016 x86_64 GNU/Linux
Python 3.5.1
aiohttp==0.21.6
This is ApacheBench, Version 2.3 <$Revision: 1706008 $>
The text was updated successfully, but these errors were encountered:
A patch for ab should be easier to implement than change all aiohttp behaviour.
BTW, you should use wrk and/or wrk2: There are more interesting than ab to saturate an aiohttp application.
Or use an efficient reverse proxy like Nginx is also a workaround: You'll saturate aiohttp before Nginx and Nginx override theses headers.
Long story short
ab
hangs when keep-alive enabled and the response is long.Expected behaviour
Expect
ab -k -n 2 http://127.0.0.1:8080/
to work.Actual behaviour
ab
hangs after sending the second request.Cause and suggestion
ab
fails to parseCONTENT-LENGTH
. From the source code ofab
we can see that there is some hand-craft HTTP parser (httpd/support/ab.c:read_connection
):Although it's
ab
that violates the HTTP standard, considering thatab
is a common tool for HTTP benchmarking, the behavior thatab
works on other HTTP library and only hangs onaiohttp
will frustrate users. Making HTTP headers camel case also have other benefits discussed in #223, #813.Steps to reproduce
Install
aiohttp
andab
, and use the above example program and command line.Your environment
Linux iceboy-m7h 4.6.2-1-ARCH #1 SMP PREEMPT Wed Jun 8 08:40:59 CEST 2016 x86_64 GNU/Linux
Python 3.5.1
aiohttp==0.21.6
This is ApacheBench, Version 2.3 <$Revision: 1706008 $>
The text was updated successfully, but these errors were encountered: