This helps. I can also reproduce the problem on my local machine
I have performed the following test:
I modified gluon/main.py function app_with_loggin() and added
import random
k = str(random.random())[2:]
line='%s request arrived\n' % k
open(logfilename, 'a').write(line)
... do web2py stuff ...
line='%s request completed %s\n' % (k, status_headers[0])[:3])
open(logfilename, 'a').write(line)
Turns out every request received by the wsgi app is completed and
returns a 200OK. Yet ab measures 11% failures. I see only two
possibilities:
1) the failures occur somehow in the web server (but why only with
this action?)
2) occasionally what web2py interprets as a 200OK, ab interprets as a
failure.
Is there a way see how a failed response look like? Whether it is a
tcp level failure or a http level failure?
For now I am going to try with tcpdump....
Massimo
On Aug 12, 10:44 am, David Marko <[email protected]> wrote:
> Massimo I just created a new thread for this problem. Failed requests
> appear with Rokcet and with wsgi as well.
> You can simply benchmark FORM examples running on your site. The same
> for my local tests.
>
> See below:
> -n = number of requests
> -c = number of concurrent requests
>
> debian:~# ab -n 100 -c 10http://web2py.com/examples/form_examples/form
> 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 web2py.com (be patient).....done
>
> Server Software: Apache/2.2.8
> Server Hostname: web2py.com
> Server Port: 80
>
> Document Path: /examples/form_examples/form
> Document Length: 24043 bytes
>
> Concurrency Level: 10
> Time taken for tests: 14.161 seconds
> Complete requests: 100
> Failed requests: 19
> (Connect: 0, Receive: 0, Length: 19, Exceptions: 0)
> Write errors: 0
> Total transferred: 2449290 bytes
> HTML transferred: 2404325 bytes
> Requests per second: 7.06 [#/sec] (mean)
> Time per request: 1416.149 [ms] (mean)
> Time per request: 141.615 [ms] (mean, across all concurrent
> requests)
> Transfer rate: 168.90 [Kbytes/sec] received