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