next up previous contents
Next: Internal Data Structures Up: The Apache HTTP Server Previous: Apache Portable Runtime   Contents

Multi-Processing Modules

Apache solves the problem of portable multiprocessing in an interesting way. It defines a few hooks that are not related to request processing, nor to the configuration. Instead, they define the behavior of the server as a set of threads. They decide, for example, what type of concurrency is used (threads or processes), when new threads are spawned, and how incoming client requests are dispatched to them. Modules providing hook functions for this special type of hooks are called Multi-Processing Modules (MPMs).

Different MPMs are usually used on different system architectures. There are, for example, separate MPMs for Windows, OS/2 and NetWare. An exception to this rule is the group of MPMs that run on Unix systems. At the moment, there are three different Unix MPMs: prefork, worker, and perchild. The first one is process-based, while the two remaining ones use mixed processes and threads.

Various MPMs can implement different request-to-thread mapping strategies. They can also use different criteria to decide when to create a new thread. In this way, not only can they use the operating system in the most efficient way, but they can also adjust every instance of Apache to the conditions occurring at the specific site (e.g., load, range of documents, their size, etc.).


next up previous contents
Next: Internal Data Structures Up: The Apache HTTP Server Previous: Apache Portable Runtime   Contents
root 2002-08-27