David Phillips wrote:
> Daniel Taylor writes:
> 
>>This is perhaps because process task switches are _already_ so
>>optimized
>>that there is little perfomance gain left to be had by going to a
>>threaded model? Perhaps Apache using a task-per-connection model is
>>_more_ scalable than a lot of other potential solutions, as well as
>>being easier to code and debug than a threaded server?
> 
> 
> You're missing the point entirely.  In terms of scalability, there is little
> difference between a process and a thread.  Both provide you with O(n)
> versus O(1).

True, but to bring up one of your comments below, even being able to 
handle N connections on a single process doesn't give you O(1), it just 
gives you O(N) with a much smaller constant. You still have the overhead 
involved with keeping track of each connection, and the (potentially 
much smaller) overhead of switching between them. Hence my disbelief.

Yeah, I am awfully pedantic when talking about algorithm complexity.
Too much embedded programming and hanging out with mathematicians.
> 
> Note that I'm talking about preemptive threads here (at the operating system
> level).  There are a variety of ways to implement non preemptive threads,
> including state machines and stack modifying coroutines.
>
Which can give you better scalability for prticular problem sets, at the 
expense of flexibility and/or clarity of code.


> 
> You need to read "The C10K problem" again.  Apache style web servers are
> artificially limited because an operating system can only handle so many
> processes.  Non blocking web servers do not have this limitation.
>
Linux does have trouble with very large numbers of processes, true.
The threaded servers get past the process count limit pretty effectively 
IIRC, leaving only the resource usage.

> 
>>Then you are talking out your ass. I disbelieve in this mythical O(1)
>>webserver of yours. I even doubt you can get O(logn).
> 
> 
> Apache requires 15 processes to handle 15 connections and 500 processes to
> handle 500 connections.  thttpd needs one process to handle 15 or 500
> connections.

O(1) on process count does not mean O(1) on resource (RAM/CPU) 
utilization. thttpd will handle much more static traffic with less than 
apache, but you can still run it out. So not O(1). OTOH, I have used
thttpd for pure static sites before, and it is great if you need a good, 
basic web server for static content.
> 
> 
>>For _most_ people, Apache is so far beyond what they need it is
>>unbelievable.
> 
> 
> Yes.  I said that already.  Remember, this whole thing started because
> people thought using .htaccess files was a bad idea for "performance"
> reasons.
> 
> (That doesn't mean it's totally irrelevant to everyone.  I currently have
> three boxes on a 300mbit pipe each handling around 1000 concurrent
> connections.  In fact, they have .htaccess support enabled and that's
> certainly not the bottleneck.)
> 


_______________________________________________
TCLUG Mailing List - Minneapolis/St. Paul, Minnesota
http://www.mn-linux.org tclug-list at mn-linux.org
https://mailman.real-time.com/mailman/listinfo/tclug-list