Simple threaded web-server based on BaseHTTPServer?

Mark Hammond mhammond at skippinet.com.au
Thu Jan 31 08:13:31 EST 2002


Thomas Weholt wrote:
>>You almost certainly don't want that for the real world.  Having a
>>thread per connection will not scale well at all.
>>
> 
> What are we talking about here; scale in regards of number of concurrent
> connections? What could one expect to in terms of performance?
> I'm not making a web-server for slashdot-like sites in regards of number of
> daily hits. This is webserver for personal sites, with a small to medium
> amount ( 10 to 1000 hits pr. day ??) of traffic. It's more important that
> it's stable, easy to understand and use.

Note that newer browsers will generally each attempt to eastablish a few 
connections (4 or 8 IIRC) for a single page view, if grahpics etc need 
to be downloaded.  So each "user" may have up to 8 connections if you 
have lots of images :)

That said, threads may still be OK.  Threads take up memory, and can be 
  slow to switch - however, serving up static HTML is hardly arduous :) 
  I would expect that if your server generally had zero users, and 
probably only ever had 10 concurrent users (and even then only rarely), 
then threads may be a reasonable solution.

Mark.




More information about the Python-list mailing list