I have been googling this question for some time but got no answers. What's the Apache process model?
By process model, I mean how Apache manage process or thread to handling HTTP request.
Does it fork one process for each HTTP request?
Does it have process/thread pool?
Can we config it?
Is there any online doc for such Apache details?
This depends on your system and configuration : see Core Features and Multi-Processing Modules : you could use, for instance :
- Apache MPM winnt on windows -- that one uses threads
- Or Apache MPM prefork -- that one uses processes
- Or even Apache MPM worker -- which uses both several processes and threads.
Quoting the page of the last one, Apache MPM worker :
This Multi-Processing Module (MPM) implements a hybrid multi-process multi-threaded server.
By using threads to serve requests, it is able to serve a large number of requests with fewer system resources than a process-based server.
However, it retains much of the stability of a process-based server by keeping multiple processes available, each with many threads.
来源:https://stackoverflow.com/questions/2438543/what-is-apache-process-model