How Apache works in 2:
1.prefork mode
The secondary multi-path processing module (MPM) implements a non-threaded, pre-derived Web server. It is suitable for systems that do not have a thread-safe library and need to avoid thread-compatibility issues, and it is the best mpm that requires each request to be handled independently, so that if a request has a problem it does not affect other requests.
This mpm has a very strong self-regulation capability and requires very little configuration instruction adjustment. The most important thing is to set the maxclients to a value large enough to handle the potential request peaks. Coworkers have to be too large to cause the memory to be used beyond the size of the physical memory.
2.worker mode
This multi-path processing module (MPM) uses a network server to support mixed multi-process multithreading. Because threads are used to process requests, you can handle a large volume of requests. and the system resource overhead is less than the process-based MPM, and it uses multiple processes, and each process has multiple threads. Higher stability than the process-based MPM.
The most important instructions for controlling this MPM are:
A) control the number of threads that are allowed to be established without a child process threadsperchild directive
b) control the maximum number of threads allowed to be established maxclients
The way Apache Works