From 8b09ca2ad99ce9eadd7918f03e48bd052856254c Mon Sep 17 00:00:00 2001 From: Joshua Slive Date: Fri, 17 Nov 2000 19:29:59 +0000 Subject: [PATCH] First attempt at MPM documentation. Feedback appreciated. Discussion to follow on apache-docs. git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@86997 13f79535-47bb-0310-9956-ffa450edef68 --- docs/manual/STATUS | 2 + docs/manual/mod/core.html | 403 --------------------------- docs/manual/mod/directives.html | 20 +- docs/manual/mod/index.html | 10 + docs/manual/mod/mpmt_pthread.html | 434 ++++++++++++++++++++++++++++++ 5 files changed, 456 insertions(+), 413 deletions(-) create mode 100644 docs/manual/mod/mpmt_pthread.html diff --git a/docs/manual/STATUS b/docs/manual/STATUS index 1c51832c2b..bc32e1b5cf 100644 --- a/docs/manual/STATUS +++ b/docs/manual/STATUS @@ -13,6 +13,8 @@ apache-docs-subscribe@apache.org on the operation of each MPM. There is also some info in htdocs/manual/mpm.html that will need to be cleaned up, linked up, and updated. + Joshua has committed + an intitial version of mpmt_pthread for discussion. - Merging of changes in 1.3. - There have been many changes in the 1.3 docs which haven't diff --git a/docs/manual/mod/core.html b/docs/manual/mod/core.html index 7119f4dd3f..e222e38d9f 100644 --- a/docs/manual/mod/core.html +++ b/docs/manual/mod/core.html @@ -59,16 +59,10 @@ always available.
  • ListenBacklog
  • <Location>
  • <LocationMatch> -
  • LockFile
  • LogLevel -
  • MaxClients
  • MaxKeepAliveRequests -
  • MaxRequestsPerChild -
  • MaxSpareServers -
  • MinSpareServers
  • NameVirtualHost
  • Options -
  • PidFile
  • Port
  • Require
  • ResourceConfig @@ -76,7 +70,6 @@ always available.
  • RLimitMEM
  • RLimitNPROC
  • Satisfy -
  • ScoreBoardFile
  • ScriptInterpreterSource
  • SendBufferSize
  • ServerAdmin @@ -87,8 +80,6 @@ always available.
  • ServerSignature
  • ServerTokens
  • ServerType -
  • StartServers -
  • ThreadsPerChild
  • ThreadStackSize
  • TimeOut
  • UseCanonicalName @@ -517,36 +508,6 @@ CGI scripts, and byte range responses do not have this header.
    -

    CoreDumpDirectory directive

    - -Syntax: CoreDumpDirectory directory
    -Default: the same location as ServerRoot
    -Context: server config
    -Status: core
    -Compatibility: Removed in version 2.0

    - -This controls the directory to which Apache attempts to switch before -dumping core. The default is in the ServerRoot -directory, however since this should not be writable by the user -the server runs as, core dumps won't normally get written. If you -want a core dump for debugging, you can use this directive to place -it in a different location.


    -

    DefaultType directive

    -

    LockFile directive

    -Syntax: LockFile filename
    -Default: LockFile logs/accept.lock
    -Context: server config
    -Status: core
    -Compatibility: Moved in version 2.0 to the -MPMs.

    - -The LockFile directive sets the path to the lockfile used when -Apache is compiled with either USE_FCNTL_SERIALIZED_ACCEPT or -USE_FLOCK_SERIALIZED_ACCEPT. This directive should normally be -left at its default value. The main reason for changing it is if -the logs directory is NFS mounted, since the lockfile -must be stored on a local disk. The PID of the main -server process is automatically appended to the filename.

    - -SECURITY: It is best to avoid putting this file in a -world writable directory such as /var/tmp because someone -could create a denial of service attack and prevent the server from -starting by creating a lockfile with the same name as the one the -server will try to create.

    - -


    -

    LogLevel directive

    E.g., when Using a level of at least crit is recommended.


    -

    MaxClients directive

    - -Syntax: MaxClients number
    -Default: MaxClients 256
    -Context: server config
    -Status: core
    -Compatibility: Moved in version 2.0 to the -MPMs.

    - -

    The MaxClients directive sets the limit on the number of simultaneous -requests that can be supported; not more than this number of child server -processes will be created. To configure more than 256 clients, you must -edit the HARD_SERVER_LIMIT entry in httpd.h and recompile. - -

    Any connection attempts over the MaxClients limit will normally -be queued, up to a number based on the -ListenBacklog directive. Once a child process is freed at the -end of a different request, the connection will then be serviced. - -


    -

    MaxKeepAliveRequests directive

    0", unlimited requests will be allowed. We recommend that this setting be kept to a high value for maximum server performance.


    -

    MaxRequestsPerChild directive

    - -Syntax: MaxRequestsPerChild number
    -Default: MaxRequestsPerChild 0
    -Context: server config
    -Status: core
    -Compatibility: Moved in version 2.0 to the -MPMs.

    - -The MaxRequestsPerChild directive sets the limit on the number of requests -that an individual child server process will handle. After MaxRequestsPerChild -requests, the child process will die. If MaxRequestsPerChild is 0, then -the process will never expire.

    - -Setting MaxRequestsPerChild to a non-zero limit has two beneficial effects: -

      -
    • it limits the amount of memory that process can consume by (accidental) -memory leakage; -
    • by giving processes a finite lifetime, it helps reduce the -number of processes when the server load reduces. -
    - -

    This directive has no effect on Win32. - -

    NOTE: For KeepAlive requests, only the first -request is counted towards this limit. In effect, it changes the -behavior to limit the number of connections per child. - -


    - -

    MaxSpareServers directive

    - -Syntax: MaxSpareServers number
    -Default: MaxSpareServers 10
    -Context: server config
    -Status: core
    -Compatibility: Moved in version 2.0 to the -MPMs.

    - -The MaxSpareServers directive sets the desired maximum number of idle -child server processes. An idle process is one which is not handling -a request. If there are more than MaxSpareServers idle, then the parent -process will kill off the excess processes.

    - -Tuning of this parameter should only be necessary on very busy sites. -Setting this parameter to a large number is almost always a bad idea.

    - -This directive has no effect when used with the Apache Web server on a -Microsoft Windows platform. - -

    - -See also MinSpareServers and -StartServers.


    - -

    MinSpareServers directive

    - -Syntax: MinSpareServers number
    -Default: MinSpareServers 5
    -Context: server config
    -Status: core
    -Compatibility: Moved in version 2.0 to the -MPMs.

    - -The MinSpareServers directive sets the desired minimum number of idle -child server processes. An idle process is one which is not handling -a request. If there are fewer than MinSpareServers idle, then the parent -process creates new children at a maximum rate of 1 per second.

    - -Tuning of this parameter should only be necessary on very busy sites. -Setting this parameter to a large number is almost always a bad idea.

    - -This directive has no effect on Microsoft Windows. - -

    - -See also MaxSpareServers and -StartServers.


    -

    NameVirtualHost directive

    The default in the absence of any other settings is All.


    -

    PidFile directive

    - -Syntax: PidFile filename
    -Default: PidFile logs/httpd.pid
    -Context: server config
    -Status: core
    -Compatibility: Removed in version 2.0.

    - -The PidFile directive sets the file to which the server records the -process id of the daemon. If the filename does not begin with a slash (/) -then it is assumed to be relative to the ServerRoot. -The PidFile is only used in standalone mode.

    -It is often useful to be able to send the server a signal, so that it closes -and then reopens its ErrorLog and TransferLog, and -re-reads its configuration files. This is done by sending a SIGHUP (kill -1) -signal to the process id listed in the PidFile.

    - -The PidFile is subject to the same warnings about log file placement and -security. - -


    Port directive

    @@ -2715,63 +2441,6 @@ See also Require and


    -

    ScoreBoardFile directive

    - -Syntax: ScoreBoardFile filename
    -Default: ScoreBoardFile logs/apache_status -
    -Context: server config
    -Status: core
    -Compatibility: Moved in version 2.0 to the -MPMs.

    - -The ScoreBoardFile directive is required on some architectures to place -a file that the server will use to communicate between its children and -the parent. The easiest way to find out if your architecture requires -a scoreboard file is to run Apache and see if it creates the file named -by the directive. If your architecture requires it then you must ensure -that this file is not used at the same time by more than one invocation -of Apache.

    - -If you have to use a ScoreBoardFile then you may see improved speed by -placing it on a RAM disk. But be careful that you heed the same warnings -about log file placement and -security.

    - -Apache 1.2 and above:

    - -Linux 1.x users might be able to add --DHAVE_SHMGET -DUSE_SHMGET_SCOREBOARD to -the EXTRA_CFLAGS in your Configuration. This -might work with some 1.x installations, but won't work with all of -them. (Prior to 1.3b4, HAVE_SHMGET would have sufficed.)

    - -SVR4 users should consider adding --DHAVE_SHMGET -DUSE_SHMGET_SCOREBOARD to the -EXTRA_CFLAGS in your Configuration. This -is believed to work, but we were unable to test it in time for 1.2 -release. (Prior to 1.3b4, HAVE_SHMGET would have sufficed.)

    - -See Also: -Stopping and Restarting Apache

    - -


    -

    ScriptInterpreterSource directive


    -

    StartServers directive

    - -Syntax: StartServers number
    -Default: StartServers 5
    -Context: server config
    -Status: core
    -Compatibility: Moved in version 2.0 to the -MPMs.

    - -The StartServers directive sets the number of child server processes created -on startup. As the number of processes is dynamically controlled depending -on the load, there is usually little reason to adjust this parameter.

    - -

    When running under Microsoft Windows, this directive has no effect. - There is always one child which handles all requests. Within the - child requests are handled by separate threads. The - ThreadsPerChild directive controls - the maximum number of child threads handling requests, which will - have a similar effect to the setting of StartServers - on Unix. - -

    - -See also MinSpareServers and -MaxSpareServers.


    - -

    ThreadsPerChild

    -Syntax: ThreadsPerChild number
    -Default: ThreadsPerChild 50
    -Context: server config
    -Status: core (Windows, NetWare)
    -Compatibility: Available only with Apache 1.3 and later -with Windows. Moved in version 2.0 to the MPMs. - -

    This directive tells the server how many threads it should use. This - is the maximum number of connections the server can handle at once; be - sure and set this number high enough for your site if you get a lot of - hits. - -

    This directive has no effect on Unix systems. Unix users should look - at StartServers and MaxRequestsPerChild.

    - -
    -

    ThreadStackSize

    CookieLog (mod_cookies)
  • CookieLog (mod_log_config)
  • CookieTracking -
  • CoreDumpDirectory +
  • CoreDumpDirectory
  • CustomLog
  • Dav
  • DavDepthInfinity @@ -152,25 +152,25 @@ of the terms used in their descriptions available.
  • LoadModule
  • <Location>
  • <LocationMatch> -
  • LockFile +
  • LockFile
  • LogFormat
  • LogLevel -
  • MaxClients +
  • MaxClients
  • MaxKeepAliveRequests -
  • MaxRequestsPerChild -
  • MaxSpareServers +
  • MaxRequestsPerChild +
  • MaxSpareThreads
  • MetaDir
  • MetaFiles
  • MetaSuffix
  • MimeMagicFile -
  • MinSpareServers +
  • MinSpareThreads
  • MMapFile
  • NameVirtualHost
  • NoCache
  • Options
  • Order
  • PassEnv -
  • PidFile +
  • PidFile
  • Port
  • ProxyBlock
  • ProxyDomain @@ -203,7 +203,7 @@ of the terms used in their descriptions available.
  • RLimitMEM
  • RLimitNPROC
  • Satisfy -
  • ScoreBoardFile +
  • ScoreBoardFile
  • Script
  • ScriptAlias
  • ScriptAliasMatch @@ -224,8 +224,8 @@ of the terms used in their descriptions available.
  • SetEnvIf
  • SetEnvIfNoCase
  • SetHandler -
  • StartServers -
  • ThreadsPerChild +
  • StartServers +
  • ThreadsPerChild
  • TimeOut
  • TransferLog
  • TypesConfig diff --git a/docs/manual/mod/index.html b/docs/manual/mod/index.html index 2e831bdac9..81f79d7d75 100644 --- a/docs/manual/mod/index.html +++ b/docs/manual/mod/index.html @@ -24,9 +24,19 @@ directives.

    +

    Core Features and Multi-Processing Modules

    +
    Core
    Core Apache features. +
    mpmt_pthread +
    Multi-Processing Model with Threading via Pthreads; Variable number +of processes, constant number of threads/child +
    + +

    Other Modules

    + +
    mod_access
    Access control based on client hostname or IP address.
    mod_actions diff --git a/docs/manual/mod/mpmt_pthread.html b/docs/manual/mod/mpmt_pthread.html new file mode 100644 index 0000000000..da3e8241d9 --- /dev/null +++ b/docs/manual/mod/mpmt_pthread.html @@ -0,0 +1,434 @@ + + + +Apache MPM mpmt_pthread + + + + + + +

    Mulit-Processing Module mpmt_pthread

    +

    +This Multi-Processing Module controls process and thread creation +using the pthread interface. +

    + +

    Status: MPM +
    +Source File: mpmt_pthread.c +
    +Module Identifier: mpm_mpmt_pthread_module +

    + +

    Summary

    + +

    This Multi-Processing Module (MPM) is the default for most unix-like +operating systems. It uses pthread system calls to create a hybrid +multi-process multi-threaded server. Each process has a fixed number +of threads. The server adjusts to handle load by increasing or +decreasing the number of processes.

    + + +

    Directives

    + +
    + +

    CoreDumpDirectory directive

    + +

    Syntax: CoreDumpDirectory directory
    +Default: the same location as ServerRoot
    +Context: server config
    +Status: Base
    +Module: mpmt_pthread

    + +

    This controls the directory to which Apache attempts to switch +before dumping core. The default is in the ServerRoot directory, however since +this should not be writable by the user the server runs as, core dumps +won't normally get written. If you want a core dump for debugging, +you can use this directive to place it in a different location.


    + +

    PidFile directive

    + +

    Syntax: PidFile filename
    +Default: PidFile logs/httpd.pid
    +Context: server config
    +Status: Base
    +Module: mpmt_pthread

    + +

    The PidFile directive sets the file to which the server records the +process id of the daemon. If the filename does not begin with a slash +(/) then it is assumed to be relative to the ServerRoot.

    + +

    It is often useful to be able to send the server a signal, so that +it closes and then reopens its ErrorLog and TransferLog, and re-reads +its configuration files. This is done by sending a SIGHUP (kill -1) +signal to the process id listed in the PidFile.

    + +

    The PidFile is subject to the same warnings about log file placement and +security.

    + + +


    + + +

    LockFile directive

    +

    Syntax: LockFile filename
    +Default: LockFile logs/accept.lock
    +Context: server config
    +Status: Base
    +Module: mpmt_pthread

    + +

    The LockFile directive sets the path to the lockfile used when +Apache is compiled with either USE_FCNTL_SERIALIZED_ACCEPT or +USE_FLOCK_SERIALIZED_ACCEPT. This directive should normally be +left at its default value. The main reason for changing it is if +the logs directory is NFS mounted, since the lockfile +must be stored on a local disk. The PID of the main +server process is automatically appended to the filename.

    + +

    SECURITY: It is best to avoid putting this file in a +world writable directory such as /var/tmp because someone +could create a denial of service attack and prevent the server from +starting by creating a lockfile with the same name as the one the +server will try to create.

    + +
    + +

    MaxClients directive

    + +

    Syntax: MaxClients number
    +Default: MaxClients 8 (with threads) +MaxClients 256 (no threads)
    +Context: server config
    +Status: core
    +Module: mpmt_pthread

    + +

    The MaxClients directive sets the limit on the number of child +processes that will be created to serve requests. When the server is +built without threading, no more than this number of clients can be +served simultaneously. To configure more than 256 clients, you must +edit the HARD_SERVER_LIMIT entry in +mpm_default.h and recompile. + +

    Any connection attempts over the MaxClients limit will normally +be queued, up to a number based on the +ListenBacklog directive. Once a child process is freed at the +end of a different request, the connection will then be serviced.

    + +

    When the server is compiled with threading, then the maximum number +of simultaneous requests that can be served is obtained from the value +of this directive multiplied by ThreadsPerChild.

    + +
    + +

    MaxRequestsPerChild directive

    + +

    Syntax: MaxRequestsPerChild number
    +Default: MaxRequestsPerChild 10000
    +Context: server config
    +Status: core
    +Module: mpmt_pthread

    + +

    The MaxRequestsPerChild directive sets the limit on the number of requests +that an individual child server process will handle. After MaxRequestsPerChild +requests, the child process will die. If MaxRequestsPerChild is 0, then +the process will never expire.

    + +Setting MaxRequestsPerChild to a non-zero limit has two beneficial effects: +

      +
    • it limits the amount of memory that process can consume by (accidental) +memory leakage; +
    • by giving processes a finite lifetime, it helps reduce the +number of processes when the server load reduces. +
    + +

    NOTE: For KeepAlive requests, only the first +request is counted towards this limit. In effect, it changes the +behavior to limit the number of connections per child. + +


    + + +

    MaxSpareThreads directive

    + +

    Syntax: MaxSpareThreads number
    +Default: MaxSpareThreads ??
    +Context: server config
    +Status: core
    +Module: mpmt_pthread

    + +

    Content needed here!

    + +

    See also MinSpareThreads and +StartServers. + +


    + +

    MinSpareThreads directive

    + +

    Syntax: MinSpareServers number
    +Default: MinSpareServers ???
    +Context: server config
    +Status: core
    +Module: mpmt_pthread

    + +

    fix me

    + +

    The MinSpareServers directive sets the desired minimum number of idle +child server processes. An idle process is one which is not handling +a request. If there are fewer than MinSpareServers idle, then the parent +process creates new children at a maximum rate of 1 per second.

    + +Tuning of this parameter should only be necessary on very busy sites. +Setting this parameter to a large number is almost always a bad idea.

    + +This directive has no effect on Microsoft Windows. + +

    + +See also MaxSpareThreads and +StartServers.


    + + +

    ScoreBoardFile directive

    + +

    Syntax: ScoreBoardFile filename
    +Default: ScoreBoardFile logs/apache_status +
    +Context: server config
    +Status: Base
    + +Module: mpmt_pthread

    + +

    The ScoreBoardFile directive is required on some architectures to place +a file that the server will use to communicate between its children and +the parent. The easiest way to find out if your architecture requires +a scoreboard file is to run Apache and see if it creates the file named +by the directive. If your architecture requires it then you must ensure +that this file is not used at the same time by more than one invocation +of Apache.

    + +

    If you have to use a ScoreBoardFile then you may see improved speed by +placing it on a RAM disk. But be careful that you heed the same warnings +about log file placement and +security.

    + +

    See Also: +Stopping and Restarting Apache

    + + +


    + +

    StartServers directive

    + +

    Syntax: StartServers number
    +Default: StartServers 5
    +Context: server config
    +Status: core
    +Module: mpmt_pthread

    + +

    The StartServers directive sets the number of child server processes created +on startup. As the number of processes is dynamically controlled depending +on the load, there is usually little reason to adjust this parameter.

    + +

    See also MinSpareThreads and +MaxSpareThreads.


    + +

    ThreadsPerChild

    +

    Syntax: ThreadsPerChild number
    +Default: ThreadsPerChild 50
    +Context: server config
    +Status: Base
    +Module: mpmt_pthread

    + +

    This directive sets the number of threads created by each child +process.

    + + + + + -- 2.50.1