[Web-SIG] Fwd: wsgiref.simple_server slow on slow network
Tibor Arpas
tibor at infinit.sk
Mon Jul 21 17:40:03 CEST 2008
Hi,
I'm quite new to python and I ran into a performance problem with
wsgiref.simple_server. I'm running this little program.
from wsgiref import simple_server
def app(environ, start_response):
start_response('200 OK', [('content-type', 'text/html')])
return ['*'*50000]
httpd = simple_server.make_server('',8080,app)
try:
httpd.serve_forever()
except KeyboardInterrupt:
pass
I get many hundreds of responses/second on my local computer, which is fine.
But when I access this server through our VPN it performs very bad.
I get 0.33 requests/second as compared to 7 responses/second when
accessing 50kB static file served by IIS.
I also tried the same little program using paste.httpserver and that
version works fast as expected.
I cannot really understand this behavior. My only thought is that the
wsgiref version is sending the data in many chunks, and therefore the
latency of the VPN comes into play. But I don't really know how to
test this.
This is Python 2.5.2 on Windows Server 2003 (same behavior on Windows
XP), testing with Apache AB as well as Firefox...
Any help would be appriciated.
Tibor
More information about the Web-SIG
mailing list