From 7e81dd29256c648e31cdee1953121d36a12e7e39 Mon Sep 17 00:00:00 2001
From: Andre Malo Apache HTTP Server Version 2.1 This Multi-Processing Module (MPM) is the default for BeOS. It uses
+ a single control process creates threads to handle requests. The Setting For A | B | C | D | E | F | G | H | I | K | L | M | N | O | P | R | S | T | U | V | X
Below is a list of all of the modules that come as part of
@@ -25,21 +25,34 @@
directives.
Apache HTTP Server Version 2.1 This MPM is experimental, so it may or may not work
+ as expected. This is an experimental variant of the standard
+ To use the This MPM depends on APR's atomic compare-and-swap operations for
+ thread synchronization. If you are compiling for an x86 target
+ and you don't need to support 386s, or you are compiling for a
+ SPARC and you don't need to run on pre-UltraSPARC chips, add
+ The If this directive is set to If you want to find out the compile time chosen default
+ for your system, you may set your The Only one This controls the directory to which Apache attempts to
switch before dumping core. The default is in the
The It is recommended that you set up a new group specifically for
running the server. Some admins use user Don't set Note: if you start the server as a non-root user, it will
- fail to change to the specified group, and will instead
- continue to run as the group of the original user. Special note: Use of this directive in Special note: Use of this directive in <VirtualHost> is
- no longer supported. To implement the suEXEC wrapper with Apache 2.0, use the
- The The Listen directive tells the server to accept incoming
- requests on the specified port or address-and-port combination.
- If only a port number is specified, the server listens to the
- given port on all interfaces. If an IP address is given as well
+ The Multiple Listen directives may be used to specify a number
- of addresses and ports to listen to. The server will respond to
- requests from any of the listed addresses and ports. Multiple For example, to make the server accept connections on both
port 80 and port 8000, use: The maximum length of the queue of pending connections.
Generally no tuning is needed or desired, however on some
@@ -202,25 +292,29 @@ listens to
The It is best to avoid putting this file in a world writable directory
- such as It is best to avoid putting this file in a world writable
+ directory such as The For non-threaded servers (i.e., For non-threaded servers (i.e., For threaded servers (i.e., For threaded and hybrid servers (e.g. The Apache MPM beos
+
+
+Description: This Multi-Processing Module is optimized for BeOS.
+Status: MPM
+Module Identifier: mpm_beos_module Source File: beos.c Summary
+
+ Directives
+
+
+See also
+MaxRequestsPerThread Directive
+
+
+
+Description: Limit on the number of requests that an individual thread
+will handle during its life
+Syntax: MaxRequestsPerThread number
+Default: MaxRequestsPerThread 0
+Context: server config
+Status: MPM
+Module: beos MaxRequestsPerThread
directive sets
+ the limit on the number of requests that an individual server thread
+ will handle. After MaxRequestsPerThread
+ requests, the thread will die. If MaxRequestsPerThread
is 0
, then the thread
+ will never expire.MaxRequestsPerThread
to a
+ non-zero limit has two beneficial effects:
+
+
+ Note:
+ KeepAlive
requests, only
+ the first request is counted towards this limit. In effect, it
+ changes the behavior to limit the number of connections
+ per thread.Apache Module core
+Apache Core Features
diff --git a/docs/manual/mod/directives.html.en b/docs/manual/mod/directives.html.en
index cd840911f1..91c2d9c58f 100644
--- a/docs/manual/mod/directives.html.en
+++ b/docs/manual/mod/directives.html.en
@@ -34,7 +34,7 @@
Description: Core Apache HTTP Server features that are always
available Status: Core
-
Module Index
See also
+Core Features and Multi-Processing Modules
worker
+MPMworker
MPMApache MPM leader
+
+
+Description: An experimental variant of the standard worker
+MPM
+Status: MPM
+Module Identifier: mpm_leader_module Source File: leader.c Summary
+
+ Warning
+ worker
MPM. It uses a Leader/Followers design pattern
+ to coordinate work among threads. For more info, see http://deuce.doc.wustl.edu/doc/pspdfs/lf.pdf.leader
MPM, add
+ --with-mpm=leader
to the configure script's arguments
+ when building the httpd.--enable-nonportable-atomics=yes
to the configure
+ script's arguments. This will cause APR to implement atomic operations
+ using efficient opcodes not available in older CPUs.Directives
+
+
+Apache Module mpm_common
+Apache MPM Common Directives
Description: A collection of directives that are implemented by
more than one multi-processing module (MPM) Status: MPM Directives
+
AcceptMutex Directive
+
+
+
+Description: Method that Apache uses to serialize multiple children
+accepting requests on network sockets
+Syntax: AcceptMutex Default|method
+Default: AcceptMutex Default
+Context: server config
+Status: MPM
+Module: leader
, perchild
, prefork
, threadpool
, worker
AcceptMutex
directives sets the
+ method that Apache uses to serialize multiple children accepting
+ requests on network sockets. Prior to Apache 2.0, the method was
+ selectable only at compile time. The optimal method to use is
+ highly architecture and platform dependent. For further details,
+ see the performance tuning
+ documentation.Default
, then the
+ compile-time selected default will be used. Other possible
+ methods are listed below. Note that not all methods are
+ available on all platforms. If a method is specified which is
+ not available, a message will be written to the error log
+ listing the available methods.
+
+
+ flock
flock(2)
system call to lock the
+ file defined by the LockFile
directive.fcntl
fnctl(2)
system call to lock the
+ file defined by the LockFile
directive.posixsem
pthread
sysvsem
LogLevel
to debug
. Then the default AcceptMutex
will be written into the ErrorLog
.BS2000Account Directive
+
+
+
+Description: Define the non-privileged account on BS2000
+machines
+Syntax: BS2000Account account
+Context: server config
+Status: MPM
+Module: perchild
, prefork
+Compatibility: Only available for BS2000 machines BS2000Account
directive is available for
+ BS2000 hosts only. It must be used to define the account number for
+ the non-privileged apache server user (which was configured using the
+ User
directive). This is
+ required by the BS2000 POSIX subsystem (to change the underlying BS2000
+ task environment by performing a sub-LOGON) to prevent CGI scripts
+ from accessing resources of the privileged account which started the
+ server, usually SYSROOT
.Note
+ BS2000Account
directive can be used.See also
+
+CoreDumpDirectory Directive
@@ -59,9 +138,8 @@ switch before dumping core
-
Default: See usage for the default setting
Context: server config
-Status: MPM
+Module: worker
, perchild
, prefork
, mpm_winnt
Module: beos
, leader
, mpm_winnt
, perchild
, prefork
, threadpool
, worker
ServerRoot
directory, however
@@ -78,39 +156,50 @@ switch before dumping core
requests
Syntax: Group unix-group
-Default: Group #-1
+Context: server config, virtual host Context: server config
-Status: MPM
+Module: worker
, perchild
, prefork
+Module: beos
, leader
, mpmt_os2
, perchild
, prefork
, threadpool
, worker
Compatibility: Only valid in global server config since Apache
+2.0 Group
directive sets the group under
which the server will answer requests. In order to use this
- directive, the stand-alone server must be run initially as root.
- Unix-group is one of:
+
+ #
followed by a group number.Example
+ Group www-group
+
nobody
,
but this is not always possible or desirable.Group www-group
Security
+ Group
(or User
) to root
unless
+ you know exactly what you are doing, and what the dangers are.<VirtualHost>
is no longer supported. To
+ configure your server for suexec use
+ SuexecUserGroup
.SuexecUserGroup
- directive. SECURITY: See User
for a discussion of the
- security considerations.Syntax: Listen [IP-address:]portnumber
Context: server config
-Status: MPM
+Module: worker
, perchild
, prefork
, mpm_winnt
+Module: beos
, leader
, mpm_netware
, mpm_winnt
, mpmt_os2
, perchild
, prefork
, threadpool
, worker
Compatibility: Required directive since Apache 2.0 Listen
directive instructs Apache to
listen to only specific IP addresses or ports; by default it
- responds to requests on all IP interfaces. The Listen directive is
- now a required directive. If it is not in the config file, the
+ responds to requests on all IP interfaces. Listen
+ is now a required directive. If it is not in the config file, the
server will fail to start. This is a change from previous versions
of Apache.Listen
directive tells the server to
+ accept incoming requests on the specified port or address-and-port
+ combination. If only a port number is specified, the server listens to
+ the given port on all interfaces. If an IP address is given as well
as a port, the server will listen on the given port and
interface.Listen
directives may be used to
+ specify a number of addresses and ports to listen to. The server will
+ respond to requests from any of the listed addresses and ports.See also
Default: ListenBacklog 511
Context: server config
-Status: MPM
+Module: worker
, perchild
, prefork
, mpm_winnt
Module: beos
, leader
, mpm_netware
, mpm_winnt
, mpmt_os2
, perchild
, prefork
, threadpool
, worker
Default: LockFile logs/accept.lock
Context: server config
-Status: MPM
+Module: worker
, perchild
, prefork
Module: leader
, perchild
, prefork
, threadpool
, worker
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.AcceptMutex
value of either
+ fcntl
or flock
. 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:
- /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./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.See also
+
+
AcceptMutex
MaxClients Directive
@@ -228,9 +322,10 @@ listens to
Description: Maximum number of child processes that will be created
to serve requests
+Syntax: MaxClients number
Default: See usage for details
Context: server config
-Status: MPM
+Module: worker
, prefork
Module: beos
, leader
, prefork
, threadpool
, worker
MaxClients
directive sets the limit
on the number of simultaneous requests that will be served. Any
@@ -240,20 +335,19 @@ to serve requests
directive. Once a child process is freed at the end of a different
request, the connection will then be serviced.prefork
),
+ prefork
),
MaxClients
translates into the maximum
number of child processes that will be launched to serve requests.
The default value is 256; to increase it, you must also raise
ServerLimit
.worker
),
- MaxClients
restricts the total
- number of threads that will be available to serve clients.
- The default value is 16 multiplied by the value of
- ThreadsPerChild
.
- To increase MaxClients
to a value
- that requires more than 16 processes, you must also
- raise ServerLimit
.beos
+ or worker
) MaxClients
restricts
+ the total number of threads that will be available to serve clients.
+ The default value for beos
is 50
. For
+ hybrid MPMs the default value is 16
(ServerLimit
) multiplied by the value of
+ 25
(ThreadsPerChild
). Therefore, to increase MaxClients
to a value that requires more than 16 processes,
+ you must also raise ServerLimit
.
-Description: Maximum amount of memory that the main allocator is allowed
to hold without calling free()
+Syntax: MaxMemFree number
+Syntax: MaxMemFree KBytes
Default: MaxMemFree 0
Context: server config
-Status: MPM
+Module: worker
, prefork
, mpm_netware
Module: beos
, leader
, mpm_netware
, prefork
, threadpool
, worker
MaxMemFree
directive sets the
maximum number of free Kbytes that the main allocator is allowed
- to hold without calling free(). When not set, or when set to
- zero, the threshold will be set to unlimited.free()
. When not set, or when set
+ to zero, the threshold will be set to unlimited.
MaxRequestsPerChild 10000
worker
, perchild
, prefork
, mpm_winnt
leader
, mpm_netware
, mpm_winnt
, mpmt_os2
, perchild
, prefork
, threadpool
, worker
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.
0
, then the process will never expire.
+
+ The default value for mpm_netware
and
+ mpm_winnt
is 0
.
Setting MaxRequestsPerChild
to a
non-zero limit has two beneficial effects:
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.
+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.
Description: | Maximum number of idle threads |
---|---|
Syntax: | MaxSpareThreads number |
Default: | See usage for details |
Context: | server config |
Status: | MPM |
Module: | mpm_netware , perchild , worker |
Module: | beos , leader , mpm_netware , mpmt_os2 , perchild , threadpool , worker |
Maximum number of idle threads. Different MPMs deal with this directive differently.
For perchild
the default is
- MaxSpareThreads 10
. This MPM monitors the number of
+ MaxSpareThreads 10
. This MPM monitors the number of
idle threads on a per-child basis. If there are too many idle
threads in that child, the server will begin to kill threads
within that child.
For worker
the default is
- MaxSpareThreads 500
. This MPM deals with idle threads
- on a server-wide basis. If there are too many idle threads in the
- server then child processes are killed until the number of idle
- threads is less than this number.
For worker
, leader
and threadpool
the default is MaxSpareThreads 250
.
+ These MPMs deal with idle threads on a server-wide basis. If there
+ are too many idle threads in the server then child processes are
+ killed until the number of idle threads is less than this number.
For mpm_netware
the default is
- MaxSpareThreads 100
. Since this MPM runs a
+ MaxSpareThreads 100
. Since this MPM runs a
single-process, the spare thread count is also server-wide.
beos
and mpmt_os2
work
+ similar to mpm_netware
. The default for
+ beos
is MaxSpareThreads 50
. For
+ mpmt_os2
the default value is 10
.
The range of the MaxSpareThreads
value
+ is restricted. Apache will correct the given value automatically
+ according to the following rules:
perchild
requires MaxSpareThreads
to be less or equal than ThreadLimit
.mpm_netware
wants the value to be greater than
+ MinSpareThreads
.leader
, threadpool
and
+ worker
the value must be greater or equal than
+ the sum of MinSpareThreads
+ and ThreadsPerChild
.Description: | Maximum number of threads per child process |
---|---|
Syntax: | MaxThreadsPerChild number |
Default: | MaxThreadsPerChild 64 |
Context: | server config |
Status: | MPM |
Module: | worker , perchild |
Maximum number of threads per child. For MPMs with a
- variable number of threads per child, this directive sets the
- maximum number of threads that will be created in each child
- process. To increase this value beyond its default, it is
- necessary to change the value of the compile-time define
- HARD_THREAD_LIMIT
and recompile the server.
MinSpareThreads number
See usage for details
mpm_netware
, perchild
, worker
beos
, leader
, mpm_netware
, mpmt_os2
, perchild
, threadpool
, worker
Minimum number of idle threads to handle request spikes.
Different MPMs deal with this directive
@@ -379,10 +484,12 @@ spikes
MinSpareThreads 5
and monitors the number of idle
threads on a per-child basis. If there aren't enough idle threads
in that child, the server will begin to create new threads within
- that child.
NumServers
to 10
and a MinSpareThreads
value of 5
, you'll have
+ at least 50 idle threads on your system.
- worker
uses a default of MinSpareThreads
- 250
and deals with idle threads on a server-wide basis. If
+
worker
, leader
and
+ threadpool
use a default of MinSpareThreads
+ 75
and deal with idle threads on a server-wide basis. If
there aren't enough idle threads in the server then child
processes are created until the number of idle threads is greater
than number.
MinSpareThreads 10
and, since it is a single-process
MPM, tracks this on a server-wide bases.
+ beos
and mpmt_os2
work
+ similar to mpm_netware
. The default for
+ beos
is MinSpareThreads 1
. For
+ mpmt_os2
the default value is 5
.
Description: | Total number of children alive at the same time |
---|---|
Syntax: | NumServers number |
Default: | NumServers 2 |
Context: | server config |
Status: | MPM |
Module: | perchild |
Number of children alive at the same time. MPMs that use - this directive do not dynamically create new child processes so - this number should be large enough to handle the requests for - the entire site.
-PidFile logs/httpd.pid
worker
, perchild
, prefork
, mpm_winnt
beos
, leader
, mpm_winnt
, mpmt_os2
, perchild
, prefork
, threadpool
, worker
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
.
ServerRoot
.
PidFile /var/run/apache.pid
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
+ so that it closes and then re-opens 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.
PidFile
.
The PidFile is subject to the same warnings about log file placement and security.
+ScoreBoardFile logs/apache_status
worker
, perchild
, prefork
beos
, leader
, mpm_winnt
, perchild
, prefork
, threadpool
, worker
Apache uses a scoreboard to communicate between its parent and child processes. Some architectures require a file to facilitate @@ -477,7 +577,8 @@ the child processes
Description: | TCP buffer size |
---|---|
Syntax: | SendBufferSize bytes |
Default: | SendBufferSize 0 |
Context: | server config |
Status: | MPM |
Module: | worker , perchild , prefork , mpm_winnt |
Module: | beos , leader , mpm_netware , mpm_winnt , mpmt_os2 , perchild , prefork , threadpool , worker |
The server will set the TCP buffer size to the number of bytes specified. Very useful to increase past standard OS defaults on high speed high latency (i.e., 100ms or so, such as transcontinental fast pipes).
+If set to the value of 0
, the server will use the
+ OS deault.
Description: | Upper limit on configurable number of processes |
---|---|
Syntax: | ServerLimit number |
Default: | ServerLimit 256 (prefork), ServerLimit 16 (worker) |
Default: | See usage for details |
Context: | server config |
Status: | MPM |
Module: | worker , prefork |
Module: | leader , perchild , prefork , threadpool , worker |
For the prefork
MPM, this directive sets the
maximum configured value for MaxClients
for the lifetime of the
@@ -522,47 +627,63 @@ the child processes
system may become unstable.
With the prefork
MPM, use this directive only
- if you need to set MaxClients
higher than 256.
+ if you need to set MaxClients
higher than 256 (default).
Do not set the value of this directive any higher than what you
might want to set MaxClients
to.
With the worker
MPM, use this directive only
+
With worker
, leader
and
+ threadpool
use this directive only
if your MaxClients
and
ThreadsPerChild
- settings require more than 16 server processes. Do not set the
- value of this directive any higher than the number of server
+ settings require more than 16 server processes (default). Do not set
+ the value of this directive any higher than the number of server
processes required by what you may want for MaxClients
and ThreadsPerChild
.
With the perchild
MPM, use this directive only
+ if you need to set NumServers
higher than 8 (default).
There is a hard limit of ServerLimit 20000
compiled
+ into the server. This is intended to avoid nasty effects caused by
+ typos.
Description: | Number of child server processes created at startup |
---|---|
Syntax: | StartServers number |
Default: | StartServers 5 |
Default: | See usage for details |
Context: | server config |
Status: | MPM |
Module: | worker |
Module: | leader , mpmt_os2 , prefork , threadpool , worker |
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.
The default value differs from MPM to MPM. For
+ leader
, threadpool
and
+ worker
the default is StartServers 3
.
+ For prefork
defaults to 5
and for
+ mpmt_os2
to 2
.
Description: | Nubmer of threads created on startup |
---|---|
Description: | Number of threads created on startup |
Syntax: | StartThreads number |
Default: | See usage for details |
Context: | server config |
Status: | MPM |
Module: | mpm_netware , perchild |
Module: | beos , mpm_netware , perchild |
Number of threads created on startup. As the number of threads is dynamically controlled depending on the @@ -578,6 +699,9 @@ the child processes process, this is the total number of threads created at startup to serve requests.
+For beos
the default is StartThreads
+ 10
. It also reflects the total number of threads created
+ at startup to serve requests.
ThreadLimit number
See usage for details
mpm_winnt
, worker
leader
, mpm_winnt
, perchild
, threadpool
, worker
This directive sets the maximum configured value for ThreadsPerChild
for the lifetime
of the Apache process. Any attempts to change this directive
@@ -606,9 +733,15 @@ per child process
current run of Apache.
The default value for ThreadLimit
is
- 64 when used with worker
and 1920 when used
- with mpm_winnt
.
1920
when used with mpm_winnt
and
+ 64
when used with the others.
+
+ There is a hard limit of ThreadLimit 20000
(or
+ ThreadLimit 15000
with mpm_winnt
)
+ compiled into the server. This is intended to avoid nasty effects
+ caused by typos.
Description: | Number of threads created by each child process |
---|---|
Syntax: | ThreadsPerChild number |
Default: | See usage for details |
Context: | server config |
Status: | MPM |
Module: | worker , mpm_winnt |
Module: | leader , mpm_winnt , threadpool , worker |
This directive sets the number of threads created by each
child process. The child creates these threads at startup and
- never creates more. If using an MPM like mpmt_winnt, where
- there is only one child process, this number should be high
+ never creates more. If using an MPM like mpm_winnt
,
+ where there is only one child process, this number should be high
enough to handle the entire load of the server. If using an MPM
- like worker, where there are multiple child processes, the
- total number of threads should be high enough to handle the
- common load on the server.
The default value for this directive is 25 when used with
- worker
and 64 when used with
- mpm_winnt
.
worker
, where there are multiple child processes,
+ the total number of threads should be high enough to handle
+ the common load on the server.
+ The default value for ThreadsPerChild
is
+ 64
when used with mpm_winnt
and
+ 25
when used with the others.
User unix-userid
User #-1
worker
, perchild
, prefork
leader
, perchild
, prefork
, threadpool
, worker
The User
directive sets the userid as
+
The User
directive sets the user ID as
which the server will answer requests. In order to use this
- directive, the standalone server must be run initially as
- root. Unix-userid is one of:
root
.
+ If you start the server as a non-root user, it will fail to change
+ to the lesser privileged user, and will instead continue to run as
+ that original user. If you do start the server as root
,
+ then it is normal for the parent process to remain running as root.
+ Unix-userid is one of:
The user should have no privileges that result in it being
able to access files that are not intended to be visible to the
outside world, and similarly, the user should not be able to
- execute code that is not meant for httpd requests. It is
+ execute code that is not meant for HTTP requests. It is
recommended that you set up a new user and group specifically for
running the server. Some admins use user nobody
, but
this is not always desirable, since the nobody
user
can have other uses on the system.
Notes: If you start the server as a non-root user, it will - fail to change to the lesser privileged user, and will instead - continue to run as that original user. If you do start the - server as root, then it is normal for the parent process to - remain running as root.
+Don't set User
(or Group
) to root
unless
+ you know exactly what you are doing, and what the dangers are.
With the perchild
MPM, which is intended to
+ server virtual hosts run under different user IDs, the
+ User
directive defines the user ID for the
+ main server and the fallback for <VirtualHost>
sections without an
+ AssignUserID
directive.
Special note: Use of this directive in <VirtualHost>
is no longer supported. To
- configure your server for suexec use
+ configure your server for suexec use
SuexecUserGroup
.
Don't set User
-(or Group
) to
-root
unless you know exactly what you are doing, and what
-the dangers are.
Although the User
directive is present
+ in the beos
and mpmt_os2
MPMs,
+ it is actually a no-op there and only exists for compatibility
+ reasons.