X-Git-Url: https://granicus.if.org/sourcecode?a=blobdiff_plain;f=docs%2Fmanual%2Fmpm.html.en;h=691ffbd17544f926382b3c95e20a6230882d3346;hb=0ae5b1af6b6bf3048d2a124e84905f63d6507dea;hp=6f7434f7f186eb7bf387cc8e92638e2d003f094b;hpb=c9156bfb15454e9ba49989b95c16b06aead6f6ab;p=apache diff --git a/docs/manual/mpm.html.en b/docs/manual/mpm.html.en index 6f7434f7f1..691ffbd175 100644 --- a/docs/manual/mpm.html.en +++ b/docs/manual/mpm.html.en @@ -1,37 +1,46 @@ - -Multi-Processing Modules (MPMs) - Apache HTTP Server +Multi-Processing Modules (MPMs) - Apache HTTP Server Version 2.5 - + + + + +

Apache HTTP Server Version 2.5

+
<-
-Apache > HTTP Server > Documentation > Version 2.1

Multi-Processing Modules (MPMs)

+Apache > HTTP Server > Documentation > Version 2.5

Multi-Processing Modules (MPMs)

Available Languages:  de  |  en  |  es  | + fr  |  ja  | - ko 

+ ko  | + tr  | + zh-cn 

This document describes what a Multi-Processing Module is and how they are used by the Apache HTTP Server.

+
  • Building an MPM as a static module
  • +
  • Building an MPM as a DSO module
  • +

    See also

    top

    Introduction

    @@ -41,13 +50,13 @@ how they are used by the Apache HTTP Server.

    platforms in a range of different environments. Different platforms and different environments often require different features, or may have different ways of implementing the same - feature most efficiently. Apache has always accommodated a wide + feature most efficiently. Apache httpd has always accommodated a wide variety of environments through its modular design. This design allows the webmaster to choose which features will be included in the server by selecting which modules to load either at compile-time or at run-time.

    -

    Apache 2.0 extends this modular design to the most basic +

    Apache HTTP Server 2.0 extends this modular design to the most basic functions of a web server. The server ships with a selection of Multi-Processing Modules (MPMs) which are responsible for binding to network ports on the machine, accepting requests, @@ -57,72 +66,146 @@ how they are used by the Apache HTTP Server.

    allows two important benefits:

    -

    At the user level, MPMs appear much like other Apache +

    At the user level, MPMs appear much like other Apache httpd modules. The main difference is that one and only one MPM must be loaded into the server at any time. The list of available MPMs appears on the module index page.

    top
    -

    Choosing an MPM

    - -

    MPMs must be chosen during configuration, and compiled into - the server. Compilers are capable of optimizing a lot of - functions if threads are used, but only if they know that - threads are being used.

    - -

    To actually choose the desired MPM, use the argument - --with-mpm=NAME with the - configure script. NAME is the name of the - desired MPM.

    - -

    Once the server has been compiled, it is possible to - determine which MPM was chosen by using ./httpd - -l. This command will list every module that is compiled - into the server, including the MPM.

    -
    top
    -

    MPM Defaults

    The following table lists the default MPMs for various operating systems. This will be the MPM selected if you do not make another choice at compile-time.

    - - - - - - - +
    BeOSbeos
    Netwarempm_netware
    OS/2mpmt_os2
    Unixprefork
    Windowsmpm_winnt
    + + +
    Netwarempm_netware
    OS/2mpmt_os2
    Unixprefork, worker, or + event, depending on platform capabilities
    Windowsmpm_winnt
    + +

    Here, 'Unix' is used to mean Unix-like operating systems, such as +Linux, BSD, Solaris, Mac OS X, etc.

    + +

    In the case of Unix, the decision as to which MPM is installed is +based on two questions:

    +

    1. Does the system support threads?

    +

    2. Does the system support thread-safe polling (Specifically, the +kqueue and epoll functions)?

    + +

    If the answer to both questions is 'yes', the default MPM is +event.

    + +

    If The answer to #1 is 'yes', but the answer to #2 is 'no', the +default will be worker.

    + +

    If the answer to both questions is 'no', then the default MPM will be +prefork.

    + +

    In practical terms, this means that the default will almost always be +event, as all modern operating systems support these +two features.

    + +
    top
    +
    +

    Building an MPM as a static module

    + +

    MPMs can be built as static modules on all platforms. A single MPM + is chosen at build time and linked into the server. The server must + be rebuilt in order to change the MPM.

    + +

    To override the default MPM choice, use the + --with-mpm=NAME option of the + configure script. NAME is the name of the + desired MPM.

    + +

    Once the server has been compiled, it is possible to determine which MPM + was chosen by using ./httpd -l. This command will list every + module that is compiled into the server, including the MPM.

    + +
    top
    +
    +

    Building an MPM as a DSO module

    + +

    On Unix and similar platforms, MPMs can be built as DSO modules and + dynamically loaded into the server in the same manner as other DSO + modules. Building MPMs as DSO modules allows the MPM to be changed by + updating the LoadModule directive + for the MPM instead of by rebuilding the server.

    + +
    LoadModule mpm_prefork_module modules/mod_mpm_prefork.so
    + + +

    Attempting to LoadModule + more than one MPM will result in a startup failure with the + following error.

    + +

    AH00534: httpd: Configuration error: More than one MPM + loaded.

    + +

    This feature is enabled using the + --enable-mpms-shared option of the configure + script. + With argument all, all possible MPMs for the platform + will be installed. Alternately, a list of MPMs can be specified as the + argument.

    + +

    The default MPM, either selected automatically or specified with the + --with-mpm option of the configure + script, will be loaded in the generated server configuration file. Edit the + LoadModule directive to select a + different MPM.

    +

    Available Languages:  de  |  en  |  es  | + fr  |  ja  | - ko 

    -
    + ko  | + tr  | + zh-cn 

    +
    top

    Comments

    Notice:
    This is not a Q&A section. Comments placed here should be pointed towards suggestions on improving the documentation or server, and may be removed again by our moderators if they are either implemented or considered invalid/off-topic. Questions on how to manage the Apache HTTP Server should be directed at either our IRC channel, #httpd, on Freenode, or sent to our mailing lists.
    +
    \ No newline at end of file