RE: InfoWorld web server shootout

Michael Nelson (mikenel@netcom.com)
Mon, 7 Jul 1997 22:16:57 -0700 (PDT)


On Monday, July 07, 1997 8:39 PM, Dean Gaudet wrote:
> First of all, threading. Naively threading apache is not going to be a
> win on linux. Tell me if I'm wrong: thread creation and process
creation
> speeds are about the same. Additionally, there's no huge memory savings
> to be had -- I see about 80k to 100k unshared data per httpd-child on
> a server with hundreds of children serving millions of hits per day.
> This is essentially only the request-specific data, plus a few other
> unshared pages.

Thread/process creation speed shouldn't matter since Apache is pre-forked,
true? With pre-forking, how are incoming HTTP requests dispatched to
the "child" servers?

> Another fun NT optimization is the whole WaitForCompletion() thing,
> which is like select() on steroids. This is where the big threading
> wins come in. WaitForCompletion has the semantic that when an i/o
> event happens it wakes up exactly one thread and hands it the event.
> Whereas select() has the semantic that it wakes up all threads and they
> fight to see who gets to deal with the event. Not only that, NT will
> wake up the most-recently awake thread which increases cache-coolness.
> To utilize this in the Apache programming model would require a user
> level threads package layered on top of kernel threads.

Yes, I/O completion is very cool.

>Unix can do almost the equivalent of TransmitFile using mmap(). You have
>open/mmap/write instead of open/TransmitFile. So to see winnings of
>TransmitFile, open/mmap once and cache the sucker.

I'm missing something -- how do you skip read()'ing the file?

> Threaded apache is some unknown time away, so I've been trying to
> figure out how to dynamically build (and adapt) an open/mmapped file
> cache in a multiprocess server. Brilliant ideas welcome. Oh yeah,
> you can assume that it's relatively cheap, and definately safe for the
> parent to blow away hundreds of children and respawn them occasionally.
> It can even do that without interrupting a hit in progress.

I just want to see Linux and Apache beat IIS... :-).

-mike