Re: Linus on Linux, Apache and Threads

Joshua E. Rodd (jerodd@noah.dhs.org)
Thu, 22 Apr 1999 18:36:24 -0400


Gary Lawrence Murphy wrote:
> In the excerpt from OpenSources on LinuxWorld, there is
> an omninous statement in Linus' musings which goes
> "Of course Linux isn't being used to its full potential even
> by today's web servers. Apache itself doesn't do the right
> thing with threads, for example"
> What *should* Apache be doing?

Apache should not use a seperate process for each HTTP request.
It ought to one of two things:

- Use a thread to handle each request, all in one process.
There is already an alpha pthreads Apache out there, but
it's virulently unstable (I used it on OS/2, and it had
SEGV/BUS errors almost nonstop). If you enjoy playing with
threads, check it out.

- Be event-driven rather than procedure-driven by using
select(2) to serve files. (Obviously CGI scripts and anything
hard to do in an event-driven manner can be done with a
new spawned/forked process.)

Note that on *.BSD, Apache's process-intensiveness is not an
issue because *.BSD kernels can fork at a mind-boggling rate.

Cheers,
Joshua.

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/