7 ms·
Using a default configuration, Apache actually maintains a pool of worker child processes which handle the actual request processing, rather than forking on eve
by rcoder 17y ago
Using a default configuration, Apache actually maintains a pool of worker child processes which handle the actual request processing, rather than forking on every incoming request. You can allow it to fork more workers under load, or keep it locked down to manage resource usage. You can also configure it to use an alternate MPM (Multi-Processing Module) to use thread pools, fork on each request, or some mix of the above.
The difference in resource usage is due more to the fact that Apache is written to be a sort of generic network service platform, rather than a lean-and-mean HTTP server. It allows plug-in modules (whether written in C, or any of the mod_perl/python/ruby/etc. dynamic language bindings) to interact with just about any stage of request processing. In addition, a default Apache install will usually link a large number of other modules in each worker
That being said, tuning Apache for performance + minimal resource usage is a bit of a black art. If you're not comfortable configuring + building your own server package from source, it's probably easier to just grab Nginx and be done with it.