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

Manlio Perillo manlio_perillo at libero.it
Tue Jul 22 18:02:35 CEST 2008


Tibor Arpas ha scritto:
> 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.
> 

wsgiref is an iterative server, if I not wrong; it serves only one 
request at a time.

On the loopback interface this is not a problem, but on Internet the 
latency of the connection make a single request time high.

paste.httpserver uses a thread pool.

 > [...]


Manlio Perillo


More information about the Web-SIG mailing list