librelist archives

« back to archive

apr poll timeout when testing python handler with ab

apr poll timeout when testing python handler with ab

From:
Dion Paragas
Date:
2011-06-10 @ 09:32
Hi,

I'm getting the following error when using ab to test the python
handler included in examples/http_0mq

strace -o handlertest.out  ab -n1 -c1 http://localhost:6767/handlertest
This is ApacheBench, Version 2.3 <$Revision: 655654 $>
Copyright 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/
Licensed to The Apache Software Foundation, http://www.apache.org/

Benchmarking localhost (be patient)...apr_poll: The timeout specified
has expired (70007)

The last few lines of the strace output:

gettimeofday({1307697357, 849634}, NULL) = 0
write(4, "GET /handlertest HTTP/1.0\r\nHost:"..., 93) = 93
gettimeofday({1307697357, 852558}, NULL) = 0
epoll_ctl(3, EPOLL_CTL_ADD, 4, {EPOLLIN, {u32=576992344,
u64=576992344}}) = 0
epoll_ctl(3, EPOLL_CTL_ADD, 4, {EPOLLIN, {u32=576992376,
u64=576992376}}) = -1 EEXIST (File exists)
epoll_wait(3, {{EPOLLIN, {u32=576992344, u64=576992344}}}, 1, 30000) =
1
read(4, "HTTP/1.1 200 OK\r\nContent-Length:"..., 8192) = 371
gettimeofday({1307697357, 856924}, NULL) = 0
epoll_ctl(3, EPOLL_CTL_ADD, 4, {EPOLLIN, {u32=576992376,
u64=576992376}}) = -1 EEXIST (File exists)
epoll_wait(3, {}, 1, 30000)             = 0
write(2, "apr_poll: The timeout specified "..., 52) = 52
close(4)                                = 0
close(3)                                = 0
exit_group(70007)                       = ?

When testing the uwsgi handler with a simple flask app, there is no
timeout and the output of strace is:

write(4, "GET /uwsgi/ HTTP/1.0\r\nHost: loca"..., 88) = 88
gettimeofday({1307696137, 125491}, NULL) = 0
epoll_ctl(3, EPOLL_CTL_ADD, 4, {EPOLLIN, {u32=561939520,
u64=561939520}}) = 0
epoll_ctl(3, EPOLL_CTL_ADD, 4, {EPOLLIN, {u32=561939552,
u64=561939552}}) = -1 EEXIST (File exists)
epoll_wait(3, {{EPOLLIN, {u32=561939520, u64=561939520}}}, 1, 30000) =
1
read(4, "HTTP/1.0 200 OK\r\nContent-Type: t"..., 8192) = 91
gettimeofday({1307696137, 130074}, NULL) = 0
epoll_ctl(3, EPOLL_CTL_ADD, 4, {EPOLLIN, {u32=561939552,
u64=561939552}}) = -1 EEXIST (File exists)
epoll_wait(3, {{EPOLLIN, {u32=561939520, u64=561939520}}}, 1, 30000) =
1
read(4, "", 8192)                       = 0
gettimeofday({1307696137, 133228}, NULL) = 0
epoll_ctl(3, EPOLL_CTL_DEL, 4, {0, {u32=0, u64=0}}) = 0
close(4)                                = 0
write(1, "..done\n", 7)                 = 7


Anyone else seeing this? I'm using the latest Mongrel2 and zmq 2.1.4

Dion

Re: [mongrel2] apr poll timeout when testing python handler with ab

From:
Zed A. Shaw
Date:
2011-06-10 @ 19:29
On Fri, Jun 10, 2011 at 10:32:45AM +0100, Dion Paragas wrote:
> Hi,
> 
> I'm getting the following error when using ab to test the python
> handler included in examples/http_0mq

Nope, but then I don't use ab because it uses HTTP 1.0 (yes, 1.0) by
default rather than 1.1, so it's not a very good testing tool since
you're always testing the "legacy backward compatible" code paths in a
server that nobody really uses.

Take a look at the bugs section:

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

"It does not implement HTTP/1.x fully; only accepts some 'expected'
forms of responses. The rather heavy use of strstr(3) shows up top in
profile, which might indicate a performance problem; i.e., you would
measure the ab performance rather than the server's."

I'd use httperf instead so that you get accurate results, but I'll check
out what could be causing this.  Enough people use ab for this that
we're stuck supporting it's erroneous protocol implementation for now.



-- 
Zed A. Shaw
http://zedshaw.com/

Re: [mongrel2] apr poll timeout when testing python handler with ab

From:
Steve Easley
Date:
2011-08-15 @ 01:55
I was having the same issue. Sending a separate socket message with a
zero-length string solved it (formatted for m2). Sending the Content-Length
header is enough to let browser connections close, but ab (being HTTP1.0 I
guess) doesn’t use it.



FYI, new to Mongrel and excited about learning more. Building some test apps
now.



Steve Easley





On Fri, Jun 10, 2011 at 10:32:45AM +0100, Dion Paragas wrote:

> Hi,

>

> I'm getting the following error when using ab to test the python

> handler included in examples/http_0mq



Nope, but then I don't use ab because it uses HTTP 1.0 (yes, 1.0) by

default rather than 1.1, so it's not a very good testing tool since

you're always testing the "legacy backward compatible" code paths in a

server that nobody really uses.



Take a look at the bugs section:



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



"It does not implement HTTP/1.x fully; only accepts some 'expected'

forms of responses. The rather heavy use of strstr(3) shows up top in

profile, which might indicate a performance problem; i.e., you would

measure the ab performance rather than the server's."



I'd use httperf instead so that you get accurate results, but I'll check

out what could be causing this.  Enough people use ab for this that

we're stuck supporting it's erroneous protocol implementation for now.

Re: [mongrel2] apr poll timeout when testing python handler with ab

From:
Dion Paragas
Date:
2011-06-13 @ 17:54
Ahh, thanks. Didn't realise that and will steer clear of using ab. 

Cheers 

On Friday, 10 June 2011 at 20:29, Zed A. Shaw wrote:

> On Fri, Jun 10, 2011 at 10:32:45AM +0100, Dion Paragas wrote:
> > Hi,
> > 
> > I'm getting the following error when using ab to test the python
> > handler included in examples/http_0mq
> 
> Nope, but then I don't use ab because it uses HTTP 1.0 (yes, 1.0) by
> default rather than 1.1, so it's not a very good testing tool since
> you're always testing the "legacy backward compatible" code paths in a
> server that nobody really uses.
> 
> Take a look at the bugs section:
> 
> http://httpd.apache.org/docs/2.0/programs/ab.html
> 
> "It does not implement HTTP/1.x fully; only accepts some 'expected'
> forms of responses. The rather heavy use of strstr(3) shows up top in
> profile, which might indicate a performance problem; i.e., you would
> measure the ab performance rather than the server's."
> 
> I'd use httperf instead so that you get accurate results, but I'll check
> out what could be causing this. Enough people use ab for this that
> we're stuck supporting it's erroneous protocol implementation for now.
> 
> 
> 
> -- 
> Zed A. Shaw
> http://zedshaw.com/