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).

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.

> The only compelling reason I've seen for multithreaded development on
> Linux is it works better for GUI programs and others that need to deal
> with stateful processing of wildly differing IO and compute channels
> cleanly.  Especially GUI games on SMP systems. Yumm!

Agreed.  I have no problem with using threads when it makes the job easier.
Having a separate thread perform work in a GUI application is quite natural.
Writing state machines for everything is rarely worthwhile.

> After a quick looksee, I don't see how any of these really relate.
> Yeah, perhaps Apache, or ANY OTHER SIMILAR webserver will run out of
> resources
> with a large number of simultaneous connections, but that is not the
> only measure of "best".

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.

> 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.

> 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.)

-- 
David Phillips <david at acz.org>
http://david.acz.org/


_______________________________________________
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