[Web-SIG] Fwd: wsgiref.simple_server slow on slow network

Graham Dumpleton graham.dumpleton at gmail.com
Tue Jul 22 01:51:30 CEST 2008


And what happens if you actually supply a content length in your response?

2008/7/22 Tibor Arpas <tibor at infinit.sk>:
> 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
> _______________________________________________
> Web-SIG mailing list
> Web-SIG at python.org
> Web SIG: http://www.python.org/sigs/web-sig
> Unsubscribe: http://mail.python.org/mailman/options/web-sig/graham.dumpleton%40gmail.com
>


More information about the Web-SIG mailing list