Re: Linus on Linux, Apache and Threads

Chris Wedgwood (cw@ix.net.nz)
Fri, 23 Apr 1999 19:05:01 +1200


> Apache should not use a seperate process for each HTTP request.

It doesn't. It uses a separate process for each simulatenous request,
but each of these processes in their lifetime may server many
requests.

> It ought to one of two things:
>
> - Use a thread to handle each request, all in one process.

No, that would be insane. Perhaps use threads the way it now uses
processes, but not one thread per request -- that would be death as
far as performance goes.

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

Maybe... but there are still probably better ways of doing this at
the extreme high end anyhow (oh, and poll would probably be preferred
for gobs of FDs).

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

*BSD kernels can fork at a very high rate, as can linux, but neither
of them need to fork all that fast for reasons I've already outlined.

-cw

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