views:

43

answers:

1

I am not familiar with internals of Apache so I am just wondering if Apache is blocking I/O or non-blocking IO?

A: 

It forks a process for each connection, so it probably is blocking (unless it watches for timeout on the same thread as the socket i/o?).

To be sure you should probably look for socket creation calls in the source, and follow accesses to the socket descriptors... I'm not even sure if Apache has to do the forking mode, maybe it has an asynchronous mode too.


Edit

Right, there are a bunch of "Multi-Processing Modules", which decide how to handle multiple HTTP requests.

Longpoke
Read the above comment - forking for each connection is unreasonable and not performance-wise saying the least.
Poni
@Poni True, looks like the modern options just let you specify a max number of threads (or children), each of which will do a certain amount of jobs asynchronously.
Longpoke
If it is non-blocking IO, what's the major difference of concurrency ability between apache and nginx?
Mickey Shine