|
Packit |
90a5c9 |
|
|
Packit |
90a5c9 |
|
|
Packit |
90a5c9 |
<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en"><head>
|
|
Packit |
90a5c9 |
<meta content="text/html; charset=ISO-8859-1" http-equiv="Content-Type" />
|
|
Packit |
90a5c9 |
|
|
Packit |
90a5c9 |
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
|
|
Packit |
90a5c9 |
This file is generated from xml source: DO NOT EDIT
|
|
Packit |
90a5c9 |
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
|
|
Packit |
90a5c9 |
-->
|
|
Packit |
90a5c9 |
<title>mpm_common - Apache HTTP Server Version 2.4</title>
|
|
Packit |
90a5c9 |
<link href="../style/css/manual.css" rel="stylesheet" media="all" type="text/css" title="Main stylesheet" />
|
|
Packit |
90a5c9 |
<link href="../style/css/manual-loose-100pc.css" rel="alternate stylesheet" media="all" type="text/css" title="No Sidebar - Default font size" />
|
|
Packit |
90a5c9 |
<link href="../style/css/manual-print.css" rel="stylesheet" media="print" type="text/css" /><link rel="stylesheet" type="text/css" href="../style/css/prettify.css" />
|
|
Packit |
90a5c9 |
<script src="../style/scripts/prettify.min.js" type="text/javascript">
|
|
Packit |
90a5c9 |
</script>
|
|
Packit |
90a5c9 |
|
|
Packit |
90a5c9 |
<link href="../images/favicon.ico" rel="shortcut icon" /></head>
|
|
Packit |
90a5c9 |
<body>
|
|
Packit |
90a5c9 |
|
|
Packit |
90a5c9 |
Modules | Directives | FAQ | Glossary | Sitemap
|
|
Packit |
90a5c9 |
Apache HTTP Server Version 2.4
|
|
Packit |
90a5c9 |
|
|
Packit |
90a5c9 |
|
|
Packit |
90a5c9 |
|
|
Packit |
90a5c9 |
Apache > HTTP Server > Documentation > Version 2.4 > Modules
|
|
Packit |
90a5c9 |
|
|
Packit |
90a5c9 |
Apache MPM Common Directives
|
|
Packit |
90a5c9 |
|
|
Packit |
90a5c9 |
Available Languages: de |
|
|
Packit |
90a5c9 |
en |
|
|
Packit |
90a5c9 |
fr |
|
|
Packit |
90a5c9 |
ja |
|
|
Packit |
90a5c9 |
tr
|
|
Packit |
90a5c9 |
|
|
Packit |
90a5c9 |
Description: | A collection of directives that are implemented by |
---|
|
|
Packit |
90a5c9 |
more than one multi-processing module (MPM)
|
|
Packit |
90a5c9 |
Status:MPM
|
|
Packit |
90a5c9 |
|
|
Packit |
90a5c9 |
Directives
|
|
Packit |
90a5c9 |
|
|
Packit |
90a5c9 |
CoreDumpDirectory
|
|
Packit |
90a5c9 |
EnableExceptionHook
|
|
Packit |
90a5c9 |
GracefulShutdownTimeout
|
|
Packit |
90a5c9 |
Listen
|
|
Packit |
39b23f |
ListenFree
|
|
Packit |
90a5c9 |
ListenBackLog
|
|
Packit |
90a5c9 |
ListenCoresBucketsRatio
|
|
Packit |
90a5c9 |
MaxConnectionsPerChild
|
|
Packit |
90a5c9 |
MaxMemFree
|
|
Packit |
90a5c9 |
MaxRequestWorkers
|
|
Packit |
90a5c9 |
MaxSpareThreads
|
|
Packit |
90a5c9 |
MinSpareThreads
|
|
Packit |
90a5c9 |
PidFile
|
|
Packit |
90a5c9 |
ReceiveBufferSize
|
|
Packit |
90a5c9 |
ScoreBoardFile
|
|
Packit |
90a5c9 |
SendBufferSize
|
|
Packit |
90a5c9 |
ServerLimit
|
|
Packit |
90a5c9 |
StartServers
|
|
Packit |
90a5c9 |
StartThreads
|
|
Packit |
90a5c9 |
ThreadLimit
|
|
Packit |
90a5c9 |
ThreadsPerChild
|
|
Packit |
90a5c9 |
ThreadStackSize
|
|
Packit |
90a5c9 |
|
|
Packit |
90a5c9 |
Bugfix checklistSee also
|
|
Packit |
90a5c9 |
|
|
Packit |
90a5c9 |
Comments
|
|
Packit |
90a5c9 |
|
|
Packit |
90a5c9 |
|
|
Packit |
90a5c9 |
|
|
Packit |
90a5c9 |
|
|
Packit |
90a5c9 |
Description:Directory where Apache HTTP Server attempts to
|
|
Packit |
90a5c9 |
switch before dumping core
|
|
Packit |
90a5c9 |
Syntax:CoreDumpDirectory directory
|
|
Packit |
90a5c9 |
Default:See usage for the default setting
|
|
Packit |
90a5c9 |
Context:server config
|
|
Packit |
90a5c9 |
Status:MPM
|
|
Packit |
90a5c9 |
Module:event , worker , prefork
|
|
Packit |
90a5c9 |
|
|
Packit |
90a5c9 |
This controls the directory to which Apache httpd attempts to
|
|
Packit |
90a5c9 |
switch before dumping core. If your operating system is configured to
|
|
Packit |
90a5c9 |
create core files in the working directory of the crashing process,
|
|
Packit |
90a5c9 |
CoreDumpDirectory is necessary to change working
|
|
Packit |
90a5c9 |
directory from the default ServerRoot
|
|
Packit |
90a5c9 |
directory, which should not be writable by the user the server runs as.
|
|
Packit |
90a5c9 |
|
|
Packit |
90a5c9 |
If you want a core dump for debugging, you can use this directive to
|
|
Packit |
90a5c9 |
place it in a different location. This directive has no effect if your
|
|
Packit |
90a5c9 |
operating system is not configured to write core files to the working directory
|
|
Packit |
90a5c9 |
of the crashing processes.
|
|
Packit |
90a5c9 |
|
|
Packit |
90a5c9 |
Core Dumps on Linux
|
|
Packit |
90a5c9 |
If Apache httpd starts as root and switches to another user, the
|
|
Packit |
90a5c9 |
Linux kernel disables core dumps even if the directory is
|
|
Packit |
90a5c9 |
writable for the process. Apache httpd (2.0.46 and later) reenables core dumps
|
|
Packit |
90a5c9 |
on Linux 2.4 and beyond, but only if you explicitly configure a CoreDumpDirectory .
|
|
Packit |
90a5c9 |
|
|
Packit |
90a5c9 |
|
|
Packit |
90a5c9 |
|
|
Packit |
90a5c9 |
Core Dumps on BSD
|
|
Packit |
90a5c9 |
To enable core-dumping of suid-executables on BSD-systems (such
|
|
Packit |
90a5c9 |
as FreeBSD), set kern.sugid_coredump to 1.
|
|
Packit |
90a5c9 |
|
|
Packit |
90a5c9 |
|
|
Packit |
90a5c9 |
|
|
Packit |
90a5c9 |
Specific signals
|
|
Packit |
90a5c9 |
CoreDumpDirectory processing only occurs for
|
|
Packit |
90a5c9 |
a select set of fatal signals: SIGFPE, SIGILL, SIGABORT,
|
|
Packit |
90a5c9 |
SIGSEGV, and SIGBUS.
|
|
Packit |
90a5c9 |
On some operating systems, SIGQUIT also results in a core dump but
|
|
Packit |
90a5c9 |
does not go through CoreDumpDirectory or
|
|
Packit |
90a5c9 |
EnableExceptionHook processing, so the core
|
|
Packit |
90a5c9 |
location is dictated entirely by the operating system.
|
|
Packit |
90a5c9 |
|
|
Packit |
90a5c9 |
|
|
Packit |
90a5c9 |
|
|
Packit |
90a5c9 |
|
|
Packit |
90a5c9 |
|
|
Packit |
90a5c9 |
|
|
Packit |
90a5c9 |
|
|
Packit |
90a5c9 |
Description:Enables a hook that runs exception handlers
|
|
Packit |
90a5c9 |
after a crash
|
|
Packit |
90a5c9 |
Syntax:EnableExceptionHook On|Off
|
|
Packit |
90a5c9 |
Default:EnableExceptionHook Off
|
|
Packit |
90a5c9 |
Context:server config
|
|
Packit |
90a5c9 |
Status:MPM
|
|
Packit |
90a5c9 |
Module:event , worker , prefork
|
|
Packit |
90a5c9 |
|
|
Packit |
90a5c9 |
For safety reasons this directive is only available if the server was
|
|
Packit |
90a5c9 |
configured with the --enable-exception-hook option. It
|
|
Packit |
90a5c9 |
enables a hook that allows external modules to plug in and do something
|
|
Packit |
90a5c9 |
after a child crashed.
|
|
Packit |
90a5c9 |
|
|
Packit |
90a5c9 |
There are already two modules, mod_whatkilledus and
|
|
Packit |
90a5c9 |
mod_backtrace that make use of this hook. Please have a
|
|
Packit |
90a5c9 |
look at Jeff Trawick's EnableExceptionHook site for more information about these.
|
|
Packit |
90a5c9 |
|
|
Packit |
90a5c9 |
|
|
Packit |
90a5c9 |
|
|
Packit |
90a5c9 |
|
|
Packit |
90a5c9 |
|
|
Packit |
90a5c9 |
Description:Specify a timeout after which a gracefully shutdown server
|
|
Packit |
90a5c9 |
will exit.
|
|
Packit |
90a5c9 |
Syntax:GracefulShutdownTimeout seconds
|
|
Packit |
90a5c9 |
Default:GracefulShutdownTimeout 0
|
|
Packit |
90a5c9 |
Context:server config
|
|
Packit |
90a5c9 |
Status:MPM
|
|
Packit |
90a5c9 |
Module:event , worker , prefork
|
|
Packit |
90a5c9 |
Compatibility:Available in version 2.2 and later
|
|
Packit |
90a5c9 |
|
|
Packit |
90a5c9 |
The GracefulShutdownTimeout specifies
|
|
Packit |
90a5c9 |
how many seconds after receiving a "graceful-stop" signal, a
|
|
Packit |
90a5c9 |
server should continue to run, handling the existing connections.
|
|
Packit |
90a5c9 |
|
|
Packit |
90a5c9 |
Setting this value to zero means that the server will wait
|
|
Packit |
90a5c9 |
indefinitely until all remaining requests have been fully served.
|
|
Packit |
90a5c9 |
|
|
Packit |
90a5c9 |
|
|
Packit |
90a5c9 |
|
|
Packit |
90a5c9 |
|
|
Packit |
90a5c9 |
|
|
Packit |
90a5c9 |
Description:IP addresses and ports that the server
|
|
Packit |
90a5c9 |
listens to
|
|
Packit |
90a5c9 |
Syntax:Listen [IP-address:]portnumber [protocol]
|
|
Packit |
90a5c9 |
Context:server config
|
|
Packit |
90a5c9 |
Status:MPM
|
|
Packit |
90a5c9 |
Module:event , worker , prefork , mpm_winnt , mpm_netware , mpmt_os2
|
|
Packit |
90a5c9 |
Compatibility:The protocol argument was added in 2.1.5
|
|
Packit |
90a5c9 |
|
|
Packit |
90a5c9 |
The Listen directive instructs Apache httpd to
|
|
Packit |
90a5c9 |
listen to only specific IP addresses or ports; by default it
|
|
Packit |
90a5c9 |
responds to requests on all IP interfaces. Listen
|
|
Packit |
90a5c9 |
is now a required directive. If it is not in the config file, the
|
|
Packit |
90a5c9 |
server will fail to start. This is a change from previous versions
|
|
Packit |
90a5c9 |
of Apache httpd.
|
|
Packit |
90a5c9 |
|
|
Packit |
90a5c9 |
The Listen directive tells the server to
|
|
Packit |
90a5c9 |
accept incoming requests on the specified port or address-and-port
|
|
Packit |
90a5c9 |
combination. If only a port number is specified, the server listens to
|
|
Packit |
90a5c9 |
the given port on all interfaces. If an IP address is given as well
|
|
Packit |
90a5c9 |
as a port, the server will listen on the given port and
|
|
Packit |
90a5c9 |
interface.
|
|
Packit |
90a5c9 |
|
|
Packit |
90a5c9 |
Multiple Listen directives may be used to
|
|
Packit |
90a5c9 |
specify a number of addresses and ports to listen to. The server will
|
|
Packit |
90a5c9 |
respond to requests from any of the listed addresses and ports.
|
|
Packit |
90a5c9 |
|
|
Packit |
90a5c9 |
For example, to make the server accept connections on both
|
|
Packit |
90a5c9 |
port 80 and port 8000, use:
|
|
Packit |
90a5c9 |
|
|
Packit |
90a5c9 |
Listen 80
|
|
Packit |
90a5c9 |
Listen 8000
|
|
Packit |
90a5c9 |
|
|
Packit |
90a5c9 |
|
|
Packit |
90a5c9 |
To make the server accept connections on two specified
|
|
Packit |
90a5c9 |
interfaces and port numbers, use
|
|
Packit |
90a5c9 |
|
|
Packit |
90a5c9 |
Listen 192.170.2.1:80
|
|
Packit |
90a5c9 |
Listen 192.170.2.5:8000
|
|
Packit |
90a5c9 |
|
|
Packit |
90a5c9 |
|
|
Packit |
90a5c9 |
IPv6 addresses must be surrounded in square brackets, as in the
|
|
Packit |
90a5c9 |
following example:
|
|
Packit |
90a5c9 |
|
|
Packit |
90a5c9 |
Listen [2001:db8::a00:20ff:fea7:ccea]:80
|
|
Packit |
90a5c9 |
|
|
Packit |
90a5c9 |
|
|
Packit |
90a5c9 |
The optional protocol argument is not required for most
|
|
Packit |
90a5c9 |
configurations. If not specified, https is the default for
|
|
Packit |
90a5c9 |
port 443 and http the default for all other ports. The
|
|
Packit |
90a5c9 |
protocol is used to determine which module should handle a request, and
|
|
Packit |
90a5c9 |
to apply protocol specific optimizations with the
|
|
Packit |
90a5c9 |
AcceptFilter directive.
|
|
Packit |
90a5c9 |
|
|
Packit |
90a5c9 |
You only need to set the protocol if you are running on non-standard
|
|
Packit |
90a5c9 |
ports. For example, running an https site on port 8443:
|
|
Packit |
90a5c9 |
|
|
Packit |
90a5c9 |
Listen 192.170.2.1:8443 https
|
|
Packit |
90a5c9 |
|
|
Packit |
90a5c9 |
|
|
Packit |
90a5c9 |
Error condition
|
|
Packit |
90a5c9 |
Multiple Listen directives for the same ip
|
|
Packit |
90a5c9 |
address and port will result in an Address already in use
|
|
Packit |
90a5c9 |
error message.
|
|
Packit |
90a5c9 |
|
|
Packit |
90a5c9 |
|
|
Packit |
90a5c9 |
|
|
Packit |
90a5c9 |
See also
|
|
Packit |
90a5c9 |
|
|
Packit |
90a5c9 |
DNS Issues
|
|
Packit |
90a5c9 |
Setting which addresses and ports Apache HTTP Server
|
|
Packit |
90a5c9 |
uses
|
|
Packit |
90a5c9 |
Further
|
|
Packit |
90a5c9 |
discussion of the Address already in use error message,
|
|
Packit |
90a5c9 |
including other causes.
|
|
Packit |
90a5c9 |
|
|
Packit |
90a5c9 |
|
|
Packit |
39b23f |
|
|
Packit |
39b23f |
|
|
Packit |
39b23f |
|
|
Packit |
39b23f |
|
|
Packit |
39b23f |
Description:IP addresses and ports that the server
|
|
Packit |
39b23f |
listens to. Doesn't require IP address to be up
|
|
Packit |
39b23f |
Syntax:ListenFree [IP-address:]portnumber [protocol]
|
|
Packit |
39b23f |
Context:server config
|
|
Packit |
39b23f |
Status:MPM
|
|
Packit |
39b23f |
Module:event , worker , prefork , mpm_winnt , mpm_netware , mpmt_os2
|
|
Packit |
39b23f |
Compatibility:This directive is currently available only in Red Hat Enterprise Linux
|
|
Packit |
39b23f |
|
|
Packit |
39b23f |
The ListenFree directive is
|
|
Packit |
39b23f |
identical to the Listen directive.
|
|
Packit |
39b23f |
The only difference is in the usage of the IP_FREEBIND socket
|
|
Packit |
39b23f |
option, which is enabled by default with ListenFree .
|
|
Packit |
39b23f |
If IP_FREEBIND is enabled, it allows httpd to bind to an IP
|
|
Packit |
39b23f |
address that is nonlocal or does not (yet) exist. This allows httpd to
|
|
Packit |
39b23f |
listen on a socket without requiring the underlying network interface
|
|
Packit |
39b23f |
or the specified dynamic IP address to be up at the time when httpd
|
|
Packit |
39b23f |
is trying to bind to it.
|
|
Packit |
39b23f |
|
|
Packit |
39b23f |
|
|
Packit |
39b23f |
|
|
Packit |
39b23f |
|
|
Packit |
90a5c9 |
|
|
Packit |
90a5c9 |
|
|
Packit |
90a5c9 |
|
|
Packit |
90a5c9 |
Description:Maximum length of the queue of pending connections
|
|
Packit |
90a5c9 |
Syntax:ListenBacklog backlog
|
|
Packit |
90a5c9 |
Default:ListenBacklog 511
|
|
Packit |
90a5c9 |
Context:server config
|
|
Packit |
90a5c9 |
Status:MPM
|
|
Packit |
90a5c9 |
Module:event , worker , prefork , mpm_winnt , mpm_netware , mpmt_os2
|
|
Packit |
90a5c9 |
|
|
Packit |
90a5c9 |
The maximum length of the queue of pending connections.
|
|
Packit |
90a5c9 |
Generally no tuning is needed or desired, however on some
|
|
Packit |
90a5c9 |
systems it is desirable to increase this when under a TCP SYN
|
|
Packit |
90a5c9 |
flood attack. See the backlog parameter to the
|
|
Packit |
90a5c9 |
listen(2) system call.
|
|
Packit |
90a5c9 |
|
|
Packit |
90a5c9 |
This will often be limited to a smaller number by the
|
|
Packit |
90a5c9 |
operating system. This varies from OS to OS. Also note that
|
|
Packit |
90a5c9 |
many OSes do not use exactly what is specified as the backlog,
|
|
Packit |
90a5c9 |
but use a number based on (but normally larger than) what is
|
|
Packit |
90a5c9 |
set.
|
|
Packit |
90a5c9 |
|
|
Packit |
90a5c9 |
|
|
Packit |
90a5c9 |
|
|
Packit |
90a5c9 |
|
|
Packit |
90a5c9 |
|
|
Packit |
90a5c9 |
Description:Ratio between the number of CPU cores (online) and the number of
|
|
Packit |
90a5c9 |
listeners' buckets
|
|
Packit |
90a5c9 |
Syntax:ListenCoresBucketsRatio ratio
|
|
Packit |
90a5c9 |
Default:ListenCoresBucketsRatio 0 (disabled)
|
|
Packit |
90a5c9 |
Context:server config
|
|
Packit |
90a5c9 |
Status:MPM
|
|
Packit |
90a5c9 |
Module:event , worker , prefork
|
|
Packit |
90a5c9 |
Compatibility:Available in Apache HTTP Server 2.4.17, with a kernel supporting
|
|
Packit |
90a5c9 |
the socket option SO_REUSEPORT and distributing new connections
|
|
Packit |
90a5c9 |
evenly across listening processes' (or threads') sockets using it (eg. Linux
|
|
Packit |
90a5c9 |
3.9 and later, but not the current implementations of SO_REUSEPORT
|
|
Packit |
90a5c9 |
in *BSDs.
|
|
Packit |
90a5c9 |
|
|
Packit |
90a5c9 |
A ratio between the number of (online) CPU cores and the
|
|
Packit |
90a5c9 |
number of listeners' buckets can be used to make Apache HTTP Server create
|
|
Packit |
90a5c9 |
num_cpu_cores / ratio listening buckets, each containing its
|
|
Packit |
90a5c9 |
own Listen -ing socket(s) on the same port(s), and
|
|
Packit |
90a5c9 |
then make each child handle a single bucket (with round-robin distribution
|
|
Packit |
90a5c9 |
of the buckets at children creation time).
|
|
Packit |
90a5c9 |
|
|
Packit |
90a5c9 |
Meaning of "online" CPU core
|
|
Packit |
90a5c9 |
On Linux (and also BSD) a CPU core can be turned on/off if
|
|
Packit |
90a5c9 |
Hotplug
|
|
Packit |
90a5c9 |
is configured, therefore ListenCoresBucketsRatio needs to
|
|
Packit |
90a5c9 |
take this parameter into account while calculating the number of buckets to create.
|
|
Packit |
90a5c9 |
|
|
Packit |
90a5c9 |
|
|
Packit |
90a5c9 |
ListenCoresBucketsRatio can improve the
|
|
Packit |
90a5c9 |
scalability when accepting new connections is/becomes the bottleneck.
|
|
Packit |
90a5c9 |
On systems with a large number of CPU cores, enabling this feature has
|
|
Packit |
90a5c9 |
been tested to show significant performances improvement and shorter
|
|
Packit |
90a5c9 |
responses time.
|
|
Packit |
90a5c9 |
|
|
Packit |
90a5c9 |
There must be at least twice the number of CPU cores than the
|
|
Packit |
90a5c9 |
configured ratio for this to be active. The recommended
|
|
Packit |
90a5c9 |
ratio is 8 , hence at least 16
|
|
Packit |
90a5c9 |
cores should be available at runtime when this value is used.
|
|
Packit |
90a5c9 |
The right ratio to obtain maximum performance needs to be calculated
|
|
Packit |
90a5c9 |
for each target system, testing multiple values and observing the variations in your
|
|
Packit |
90a5c9 |
key performance metrics.
|
|
Packit |
90a5c9 |
|
|
Packit |
90a5c9 |
This directive influences the calculation of the
|
|
Packit |
90a5c9 |
MinSpareThreads and
|
|
Packit |
90a5c9 |
MaxSpareThreads lower bound values.
|
|
Packit |
90a5c9 |
The number of children processes needs to be a multiple of the number
|
|
Packit |
90a5c9 |
of buckets to optimally accept connections.
|
|
Packit |
90a5c9 |
|
|
Packit |
90a5c9 |
|
|
Packit |
90a5c9 |
Multiple Listen ers or Apache HTTP servers on
|
|
Packit |
90a5c9 |
the same IP address and port
|
|
Packit |
90a5c9 |
Setting the SO_REUSEPORT option on the listening socket(s)
|
|
Packit |
90a5c9 |
consequently allows multiple processes (sharing the same EUID ,
|
|
Packit |
90a5c9 |
e.g. root ) to bind to the the same IP address and port,
|
|
Packit |
90a5c9 |
without the binding error raised by the system in the usual case.
|
|
Packit |
90a5c9 |
This also means that multiple instances of Apache httpd configured on a
|
|
Packit |
90a5c9 |
same IP:port and with a positive ListenCoresBucketsRatio
|
|
Packit |
90a5c9 |
would start without an error too, and then run with incoming connections
|
|
Packit |
90a5c9 |
evenly distributed accross both instances (this is NOT a recommendation or
|
|
Packit |
90a5c9 |
a sensible usage in any case, but just a notice that it would prevent such
|
|
Packit |
90a5c9 |
possible issues to be detected).
|
|
Packit |
90a5c9 |
Within the same instance, Apache httpd will check and fail to start if
|
|
Packit |
90a5c9 |
multiple Listen directives on the exact same IP (or
|
|
Packit |
90a5c9 |
hostname) and port are configured, thus avoiding the creation of some
|
|
Packit |
90a5c9 |
duplicated buckets which would be useless and kill performances. However
|
|
Packit |
90a5c9 |
it can't (and won't try harder to) catch all the possible overlapping cases
|
|
Packit |
90a5c9 |
(like a hostname resolving to an IP used elsewhere).
|
|
Packit |
90a5c9 |
|
|
Packit |
90a5c9 |
|
|
Packit |
90a5c9 |
|
|
Packit |
90a5c9 |
|
|
Packit |
90a5c9 |
|
|
Packit |
90a5c9 |
|
|
Packit |
90a5c9 |
Description:Limit on the number of connections that an individual child server
|
|
Packit |
90a5c9 |
will handle during its life
|
|
Packit |
90a5c9 |
Syntax:MaxConnectionsPerChild number
|
|
Packit |
90a5c9 |
Default:MaxConnectionsPerChild 0
|
|
Packit |
90a5c9 |
Context:server config
|
|
Packit |
90a5c9 |
Status:MPM
|
|
Packit |
90a5c9 |
Module:event , worker , prefork , mpm_winnt , mpm_netware , mpmt_os2
|
|
Packit |
90a5c9 |
Compatibility:Available Apache HTTP Server 2.3.9 and later. The old name
|
|
Packit |
90a5c9 |
MaxRequestsPerChild is still supported.
|
|
Packit |
90a5c9 |
|
|
Packit |
90a5c9 |
The MaxConnectionsPerChild directive sets
|
|
Packit |
90a5c9 |
the limit on the number of connections that an individual child
|
|
Packit |
90a5c9 |
server process will handle. After
|
|
Packit |
90a5c9 |
MaxConnectionsPerChild connections, the child
|
|
Packit |
90a5c9 |
process will die. If MaxConnectionsPerChild is
|
|
Packit |
90a5c9 |
0 , then the process will never expire.
|
|
Packit |
90a5c9 |
|
|
Packit |
90a5c9 |
Setting MaxConnectionsPerChild to a
|
|
Packit |
90a5c9 |
non-zero value limits the amount of memory that process can consume
|
|
Packit |
90a5c9 |
by (accidental) memory leakage.
|
|
Packit |
90a5c9 |
|
|
Packit |
90a5c9 |
|
|
Packit |
90a5c9 |
|
|
Packit |
90a5c9 |
|
|
Packit |
90a5c9 |
|
|
Packit |
90a5c9 |
Description:Maximum amount of memory that the main allocator is allowed
|
|
Packit |
90a5c9 |
to hold without calling free()
|
|
Packit |
90a5c9 |
Syntax:MaxMemFree KBytes
|
|
Packit |
90a5c9 |
Default:MaxMemFree 2048
|
|
Packit |
90a5c9 |
Context:server config
|
|
Packit |
90a5c9 |
Status:MPM
|
|
Packit |
90a5c9 |
Module:event , worker , prefork , mpm_winnt , mpm_netware
|
|
Packit |
90a5c9 |
|
|
Packit |
90a5c9 |
The MaxMemFree directive sets the
|
|
Packit |
90a5c9 |
maximum number of free Kbytes that every allocator is allowed
|
|
Packit |
90a5c9 |
to hold without calling free() . In threaded MPMs, every
|
|
Packit |
90a5c9 |
thread has its own allocator. When set
|
|
Packit |
90a5c9 |
to zero, the threshold will be set to unlimited.
|
|
Packit |
90a5c9 |
|
|
Packit |
90a5c9 |
|
|
Packit |
90a5c9 |
|
|
Packit |
90a5c9 |
|
|
Packit |
90a5c9 |
|
|
Packit |
90a5c9 |
Description:Maximum number of connections that will be processed
|
|
Packit |
90a5c9 |
simultaneously
|
|
Packit |
90a5c9 |
Syntax:MaxRequestWorkers number
|
|
Packit |
90a5c9 |
Default:See usage for details
|
|
Packit |
90a5c9 |
Context:server config
|
|
Packit |
90a5c9 |
Status:MPM
|
|
Packit |
90a5c9 |
Module:event , worker , prefork
|
|
Packit |
90a5c9 |
|
|
Packit |
90a5c9 |
The MaxRequestWorkers directive sets the limit
|
|
Packit |
90a5c9 |
on the number of simultaneous requests that will be served. Any
|
|
Packit |
90a5c9 |
connection attempts over the MaxRequestWorkers
|
|
Packit |
90a5c9 |
limit will normally be queued, up to a number based on the
|
|
Packit |
90a5c9 |
ListenBacklog
|
|
Packit |
90a5c9 |
directive. Once a child process is freed at the end of a different
|
|
Packit |
90a5c9 |
request, the connection will then be serviced.
|
|
Packit |
90a5c9 |
|
|
Packit |
90a5c9 |
For non-threaded servers (i.e., prefork ),
|
|
Packit |
90a5c9 |
MaxRequestWorkers translates into the maximum
|
|
Packit |
90a5c9 |
number of child processes that will be launched to serve requests.
|
|
Packit |
90a5c9 |
The default value is 256 ; to increase it, you must also raise
|
|
Packit |
90a5c9 |
ServerLimit .
|
|
Packit |
90a5c9 |
|
|
Packit |
90a5c9 |
For threaded and hybrid servers (e.g. event
|
|
Packit |
90a5c9 |
or worker ) MaxRequestWorkers restricts
|
|
Packit |
90a5c9 |
the total number of threads that will be available to serve clients.
|
|
Packit |
90a5c9 |
For hybrid MPMs the default value is 16 (ServerLimit ) multiplied by the value of
|
|
Packit |
90a5c9 |
25 (ThreadsPerChild ). Therefore, to increase MaxRequestWorkers to a value that requires more than 16 processes,
|
|
Packit |
90a5c9 |
you must also raise ServerLimit .
|
|
Packit |
90a5c9 |
|
|
Packit |
90a5c9 |
MaxRequestWorkers was called
|
|
Packit |
90a5c9 |
MaxClients before version 2.3.13. The old name is still
|
|
Packit |
90a5c9 |
supported.
|
|
Packit |
90a5c9 |
|
|
Packit |
90a5c9 |
|
|
Packit |
90a5c9 |
|
|
Packit |
90a5c9 |
|
|
Packit |
90a5c9 |
|
|
Packit |
90a5c9 |
Description:Maximum number of idle threads
|
|
Packit |
90a5c9 |
Syntax:MaxSpareThreads number
|
|
Packit |
90a5c9 |
Default:See usage for details
|
|
Packit |
90a5c9 |
Context:server config
|
|
Packit |
90a5c9 |
Status:MPM
|
|
Packit |
90a5c9 |
Module:event , worker , mpm_netware , mpmt_os2
|
|
Packit |
90a5c9 |
|
|
Packit |
90a5c9 |
Maximum number of idle threads. Different MPMs deal with this
|
|
Packit |
90a5c9 |
directive differently.
|
|
Packit |
90a5c9 |
|
|
Packit |
90a5c9 |
For worker and event , the default is
|
|
Packit |
90a5c9 |
MaxSpareThreads 250 . These MPMs deal with idle threads
|
|
Packit |
90a5c9 |
on a server-wide basis. If there are too many idle threads in the
|
|
Packit |
90a5c9 |
server then child processes are killed until the number of idle
|
|
Packit |
90a5c9 |
threads is less than this number. Additional processes/threads
|
|
Packit |
90a5c9 |
might be created if ListenCoresBucketsRatio
|
|
Packit |
90a5c9 |
is enabled.
|
|
Packit |
90a5c9 |
|
|
Packit |
90a5c9 |
For mpm_netware the default is
|
|
Packit |
90a5c9 |
MaxSpareThreads 100 . Since this MPM runs a
|
|
Packit |
90a5c9 |
single-process, the spare thread count is also server-wide.
|
|
Packit |
90a5c9 |
|
|
Packit |
90a5c9 |
mpmt_os2 works
|
|
Packit |
90a5c9 |
similar to mpm_netware . For
|
|
Packit |
90a5c9 |
mpmt_os2 the default value is 10 .
|
|
Packit |
90a5c9 |
|
|
Packit |
90a5c9 |
Restrictions
|
|
Packit |
90a5c9 |
The range of the MaxSpareThreads value
|
|
Packit |
90a5c9 |
is restricted. Apache httpd will correct the given value automatically
|
|
Packit |
90a5c9 |
according to the following rules:
|
|
Packit |
90a5c9 |
|
|
Packit |
90a5c9 |
mpm_netware wants the value to be greater than
|
|
Packit |
90a5c9 |
MinSpareThreads .
|
|
Packit |
90a5c9 |
|
|
Packit |
90a5c9 |
For worker and event , the value
|
|
Packit |
90a5c9 |
must be greater or equal to the sum of
|
|
Packit |
90a5c9 |
MinSpareThreads and
|
|
Packit |
90a5c9 |
ThreadsPerChild.
|
|
Packit |
90a5c9 |
|
|
Packit |
90a5c9 |
|
|
Packit |
90a5c9 |
|
|
Packit |
90a5c9 |
See also
|
|
Packit |
90a5c9 |
|
|
Packit |
90a5c9 |
MinSpareThreads
|
|
Packit |
90a5c9 |
StartServers
|
|
Packit |
90a5c9 |
MaxSpareServers
|
|
Packit |
90a5c9 |
|
|
Packit |
90a5c9 |
|
|
Packit |
90a5c9 |
|
|
Packit |
90a5c9 |
|
|
Packit |
90a5c9 |
|
|
Packit |
90a5c9 |
Description:Minimum number of idle threads available to handle request
|
|
Packit |
90a5c9 |
spikes
|
|
Packit |
90a5c9 |
Syntax:MinSpareThreads number
|
|
Packit |
90a5c9 |
Default:See usage for details
|
|
Packit |
90a5c9 |
Context:server config
|
|
Packit |
90a5c9 |
Status:MPM
|
|
Packit |
90a5c9 |
Module:event , worker , mpm_netware , mpmt_os2
|
|
Packit |
90a5c9 |
|
|
Packit |
90a5c9 |
Minimum number of idle threads to handle request spikes.
|
|
Packit |
90a5c9 |
Different MPMs deal with this directive differently.
|
|
Packit |
90a5c9 |
|
|
Packit |
90a5c9 |
worker and event use a default of
|
|
Packit |
90a5c9 |
MinSpareThreads 75 and deal with idle threads on a server-wide
|
|
Packit |
90a5c9 |
basis. If there aren't enough idle threads in the server then child
|
|
Packit |
90a5c9 |
processes are created until the number of idle threads is greater
|
|
Packit |
90a5c9 |
than number. Additional processes/threads
|
|
Packit |
90a5c9 |
might be created if ListenCoresBucketsRatio
|
|
Packit |
90a5c9 |
is enabled.
|
|
Packit |
90a5c9 |
|
|
Packit |
90a5c9 |
mpm_netware uses a default of
|
|
Packit |
90a5c9 |
MinSpareThreads 10 and, since it is a single-process
|
|
Packit |
90a5c9 |
MPM, tracks this on a server-wide bases.
|
|
Packit |
90a5c9 |
|
|
Packit |
90a5c9 |
mpmt_os2 works
|
|
Packit |
90a5c9 |
similar to mpm_netware . For
|
|
Packit |
90a5c9 |
mpmt_os2 the default value is 5 .
|
|
Packit |
90a5c9 |
|
|
Packit |
90a5c9 |
See also
|
|
Packit |
90a5c9 |
|
|
Packit |
90a5c9 |
MaxSpareThreads
|
|
Packit |
90a5c9 |
StartServers
|
|
Packit |
90a5c9 |
MinSpareServers
|
|
Packit |
90a5c9 |
|
|
Packit |
90a5c9 |
|
|
Packit |
90a5c9 |
|
|
Packit |
90a5c9 |
|
|
Packit |
90a5c9 |
|
|
Packit |
90a5c9 |
Description:File where the server records the process ID
|
|
Packit |
90a5c9 |
of the daemon
|
|
Packit |
90a5c9 |
Syntax:PidFile filename
|
|
Packit |
90a5c9 |
Default:PidFile logs/httpd.pid
|
|
Packit |
90a5c9 |
Context:server config
|
|
Packit |
90a5c9 |
Status:MPM
|
|
Packit |
90a5c9 |
Module:event , worker , prefork , mpm_winnt , mpmt_os2
|
|
Packit |
90a5c9 |
|
|
Packit |
90a5c9 |
The PidFile directive sets the file to
|
|
Packit |
90a5c9 |
which the server records the process id of the daemon. If the
|
|
Packit |
90a5c9 |
filename is not absolute then it is assumed to be relative to the
|
|
Packit |
90a5c9 |
ServerRoot .
|
|
Packit |
90a5c9 |
|
|
Packit |
90a5c9 |
ExamplePidFile /var/run/apache.pid
|
|
Packit |
90a5c9 |
|
|
Packit |
90a5c9 |
|
|
Packit |
90a5c9 |
It is often useful to be able to send the server a signal,
|
|
Packit |
90a5c9 |
so that it closes and then re-opens its ErrorLog and TransferLog , and
|
|
Packit |
90a5c9 |
re-reads its configuration files. This is done by sending a
|
|
Packit |
90a5c9 |
SIGHUP (kill -1) signal to the process id listed in the
|
|
Packit |
90a5c9 |
PidFile .
|
|
Packit |
90a5c9 |
|
|
Packit |
90a5c9 |
The PidFile is subject to the same
|
|
Packit |
90a5c9 |
warnings about log file placement and security.
|
|
Packit |
90a5c9 |
|
|
Packit |
90a5c9 |
Note
|
|
Packit |
90a5c9 |
As of Apache HTTP Server 2, we recommended that you only use the apachectl script, or the init script that your OS provides,
|
|
Packit |
90a5c9 |
for (re-)starting or stopping the server.
|
|
Packit |
90a5c9 |
|
|
Packit |
90a5c9 |
|
|
Packit |
90a5c9 |
|
|
Packit |
90a5c9 |
|
|
Packit |
90a5c9 |
|
|
Packit |
90a5c9 |
|
|
Packit |
90a5c9 |
Description:TCP receive buffer size
|
|
Packit |
90a5c9 |
Syntax:ReceiveBufferSize bytes
|
|
Packit |
90a5c9 |
Default:ReceiveBufferSize 0
|
|
Packit |
90a5c9 |
Context:server config
|
|
Packit |
90a5c9 |
Status:MPM
|
|
Packit |
90a5c9 |
Module:event , worker , prefork , mpm_winnt , mpm_netware , mpmt_os2
|
|
Packit |
90a5c9 |
|
|
Packit |
90a5c9 |
The server will set the TCP receive buffer size to the number of
|
|
Packit |
90a5c9 |
bytes specified.
|
|
Packit |
90a5c9 |
|
|
Packit |
90a5c9 |
If set to the value of 0 , the server will use the
|
|
Packit |
90a5c9 |
OS default.
|
|
Packit |
90a5c9 |
|
|
Packit |
90a5c9 |
|
|
Packit |
90a5c9 |
|
|
Packit |
90a5c9 |
|
|
Packit |
90a5c9 |
|
|
Packit |
90a5c9 |
Description:Location of the file used to store coordination data for
|
|
Packit |
90a5c9 |
the child processes
|
|
Packit |
90a5c9 |
Syntax:ScoreBoardFile file-path
|
|
Packit |
90a5c9 |
Default:ScoreBoardFile logs/apache_runtime_status
|
|
Packit |
90a5c9 |
Context:server config
|
|
Packit |
90a5c9 |
Status:MPM
|
|
Packit |
90a5c9 |
Module:event , worker , prefork , mpm_winnt
|
|
Packit |
90a5c9 |
|
|
Packit |
90a5c9 |
Apache HTTP Server uses a scoreboard to communicate between its parent
|
|
Packit |
90a5c9 |
and child processes. Some architectures require a file to facilitate
|
|
Packit |
90a5c9 |
this communication. If the file is left unspecified, Apache httpd first
|
|
Packit |
90a5c9 |
attempts to create the scoreboard entirely in memory (using anonymous
|
|
Packit |
90a5c9 |
shared memory) and, failing that, will attempt to create the file on
|
|
Packit |
90a5c9 |
disk (using file-based shared memory). Specifying this directive causes
|
|
Packit |
90a5c9 |
Apache httpd to always create the file on the disk.
|
|
Packit |
90a5c9 |
|
|
Packit |
90a5c9 |
ExampleScoreBoardFile /var/run/apache_runtime_status
|
|
Packit |
90a5c9 |
|
|
Packit |
90a5c9 |
|
|
Packit |
90a5c9 |
File-based shared memory is useful for third-party applications
|
|
Packit |
90a5c9 |
that require direct access to the scoreboard.
|
|
Packit |
90a5c9 |
|
|
Packit |
90a5c9 |
If you use a ScoreBoardFile then
|
|
Packit |
90a5c9 |
you may see improved speed by placing it on a RAM disk. But be
|
|
Packit |
90a5c9 |
careful that you heed the same warnings about log file placement
|
|
Packit |
90a5c9 |
and security.
|
|
Packit |
90a5c9 |
|
|
Packit |
90a5c9 |
See also
|
|
Packit |
90a5c9 |
|
|
Packit |
90a5c9 |
Stopping and Restarting
|
|
Packit |
90a5c9 |
Apache HTTP Server
|
|
Packit |
90a5c9 |
|
|
Packit |
90a5c9 |
|
|
Packit |
90a5c9 |
|
|
Packit |
90a5c9 |
|
|
Packit |
90a5c9 |
|
|
Packit |
90a5c9 |
Description:TCP buffer size
|
|
Packit |
90a5c9 |
Syntax:SendBufferSize bytes
|
|
Packit |
90a5c9 |
Default:SendBufferSize 0
|
|
Packit |
90a5c9 |
Context:server config
|
|
Packit |
90a5c9 |
Status:MPM
|
|
Packit |
90a5c9 |
Module:event , worker , prefork , mpm_winnt , mpm_netware , mpmt_os2
|
|
Packit |
90a5c9 |
|
|
Packit |
90a5c9 |
Sets the server's TCP send buffer size to the number of bytes
|
|
Packit |
90a5c9 |
specified. It is often useful to set this past the OS's standard
|
|
Packit |
90a5c9 |
default value on high speed, high latency connections
|
|
Packit |
90a5c9 |
(i.e., 100ms or so, such as transcontinental fast pipes).
|
|
Packit |
90a5c9 |
|
|
Packit |
90a5c9 |
If set to the value of 0 , the server will use the
|
|
Packit |
90a5c9 |
default value provided by your OS.
|
|
Packit |
90a5c9 |
|
|
Packit |
90a5c9 |
Further configuration of your operating system may be required to elicit
|
|
Packit |
90a5c9 |
better performance on high speed, high latency connections.
|
|
Packit |
90a5c9 |
|
|
Packit |
90a5c9 |
On some operating systems, changes in TCP behavior resulting
|
|
Packit |
90a5c9 |
from a larger SendBufferSize may not be seen unless
|
|
Packit |
90a5c9 |
EnableSendfile is set to OFF. This
|
|
Packit |
90a5c9 |
interaction applies only to static files.
|
|
Packit |
90a5c9 |
|
|
Packit |
90a5c9 |
|
|
Packit |
90a5c9 |
|
|
Packit |
90a5c9 |
|
|
Packit |
90a5c9 |
|
|
Packit |
90a5c9 |
|
|
Packit |
90a5c9 |
Description:Upper limit on configurable number of processes
|
|
Packit |
90a5c9 |
Syntax:ServerLimit number
|
|
Packit |
90a5c9 |
Default:See usage for details
|
|
Packit |
90a5c9 |
Context:server config
|
|
Packit |
90a5c9 |
Status:MPM
|
|
Packit |
90a5c9 |
Module:event , worker , prefork
|
|
Packit |
90a5c9 |
|
|
Packit |
90a5c9 |
For the prefork MPM, this directive sets the
|
|
Packit |
90a5c9 |
maximum configured value for MaxRequestWorkers for the lifetime of the
|
|
Packit |
90a5c9 |
Apache httpd process. For the worker and event
|
|
Packit |
90a5c9 |
MPMs, this directive in combination with ThreadLimit sets
|
|
Packit |
90a5c9 |
the maximum configured value for MaxRequestWorkers for the lifetime of the
|
|
Packit |
90a5c9 |
Apache httpd process. For the event MPM, this directive
|
|
Packit |
90a5c9 |
also defines how many old server processes may keep running and finish processing
|
|
Packit |
90a5c9 |
open connections.
|
|
Packit |
90a5c9 |
Any attempts to change this directive during a restart will be ignored, but
|
|
Packit |
90a5c9 |
MaxRequestWorkers can be modified
|
|
Packit |
90a5c9 |
during a restart.
|
|
Packit |
90a5c9 |
|
|
Packit |
90a5c9 |
Special care must be taken when using this directive. If
|
|
Packit |
90a5c9 |
ServerLimit is set to a value much higher
|
|
Packit |
90a5c9 |
than necessary, extra, unused shared memory will be allocated. If
|
|
Packit |
90a5c9 |
both ServerLimit and MaxRequestWorkers are set to values
|
|
Packit |
90a5c9 |
higher than the system can handle, Apache httpd may not start or the
|
|
Packit |
90a5c9 |
system may become unstable.
|
|
Packit |
90a5c9 |
|
|
Packit |
90a5c9 |
With the prefork MPM, use this directive only
|
|
Packit |
90a5c9 |
if you need to set MaxRequestWorkers higher than 256 (default).
|
|
Packit |
90a5c9 |
Do not set the value of this directive any higher than what you
|
|
Packit |
90a5c9 |
might want to set MaxRequestWorkers to.
|
|
Packit |
90a5c9 |
|
|
Packit |
90a5c9 |
With worker , use this directive only if your
|
|
Packit |
90a5c9 |
MaxRequestWorkers
|
|
Packit |
90a5c9 |
and ThreadsPerChild
|
|
Packit |
90a5c9 |
settings require more than 16 server processes (default). Do not set
|
|
Packit |
90a5c9 |
the value of this directive any higher than the number of server
|
|
Packit |
90a5c9 |
processes required by what you may want for MaxRequestWorkers and ThreadsPerChild .
|
|
Packit |
90a5c9 |
|
|
Packit |
90a5c9 |
With event , increase this directive if the process
|
|
Packit |
90a5c9 |
number defined by your MaxRequestWorkers and ThreadsPerChild settings, plus the
|
|
Packit |
90a5c9 |
number of gracefully shutting down processes, is more than 16 server
|
|
Packit |
90a5c9 |
processes (default).
|
|
Packit |
90a5c9 |
|
|
Packit |
90a5c9 |
Note
|
|
Packit |
90a5c9 |
There is a hard limit of ServerLimit 20000 compiled
|
|
Packit |
90a5c9 |
into the server (for the prefork MPM 200000). This is
|
|
Packit |
90a5c9 |
intended to avoid nasty effects caused by typos. To increase it
|
|
Packit |
90a5c9 |
even further past this limit, you will need to modify the value of
|
|
Packit |
90a5c9 |
MAX_SERVER_LIMIT in the mpm source file and rebuild the server.
|
|
Packit |
90a5c9 |
|
|
Packit |
90a5c9 |
|
|
Packit |
90a5c9 |
See also
|
|
Packit |
90a5c9 |
|
|
Packit |
90a5c9 |
Stopping and Restarting Apache HTTP Server
|
|
Packit |
90a5c9 |
|
|
Packit |
90a5c9 |
|
|
Packit |
90a5c9 |
|
|
Packit |
90a5c9 |
|
|
Packit |
90a5c9 |
|
|
Packit |
90a5c9 |
Description:Number of child server processes created at startup
|
|
Packit |
90a5c9 |
Syntax:StartServers number
|
|
Packit |
90a5c9 |
Default:See usage for details
|
|
Packit |
90a5c9 |
Context:server config
|
|
Packit |
90a5c9 |
Status:MPM
|
|
Packit |
90a5c9 |
Module:event , worker , prefork , mpmt_os2
|
|
Packit |
90a5c9 |
|
|
Packit |
90a5c9 |
The StartServers directive sets the
|
|
Packit |
90a5c9 |
number of child server processes created on startup. As the number
|
|
Packit |
90a5c9 |
of processes is dynamically controlled depending on the load, (see
|
|
Packit |
90a5c9 |
MinSpareThreads ,
|
|
Packit |
90a5c9 |
MaxSpareThreads ,
|
|
Packit |
90a5c9 |
MinSpareServers , MaxSpareServers )
|
|
Packit |
90a5c9 |
there is usually little reason to adjust this parameter.
|
|
Packit |
90a5c9 |
|
|
Packit |
90a5c9 |
The default value differs from MPM to MPM. worker and
|
|
Packit |
90a5c9 |
event default to StartServers 3 ;
|
|
Packit |
90a5c9 |
prefork defaults to 5 ; mpmt_os2
|
|
Packit |
90a5c9 |
defaults to 2 .
|
|
Packit |
90a5c9 |
|
|
Packit |
90a5c9 |
|
|
Packit |
90a5c9 |
|
|
Packit |
90a5c9 |
|
|
Packit |
90a5c9 |
|
|
Packit |
90a5c9 |
Description:Number of threads created on startup
|
|
Packit |
90a5c9 |
Syntax:StartThreads number
|
|
Packit |
90a5c9 |
Default:See usage for details
|
|
Packit |
90a5c9 |
Context:server config
|
|
Packit |
90a5c9 |
Status:MPM
|
|
Packit |
90a5c9 |
Module:mpm_netware
|
|
Packit |
90a5c9 |
|
|
Packit |
90a5c9 |
Number of threads created on startup. As the
|
|
Packit |
90a5c9 |
number of threads is dynamically controlled depending on the
|
|
Packit |
90a5c9 |
load, (see
|
|
Packit |
90a5c9 |
MinSpareThreads ,
|
|
Packit |
90a5c9 |
MaxSpareThreads ,
|
|
Packit |
90a5c9 |
MinSpareServers , MaxSpareServers )
|
|
Packit |
90a5c9 |
there is usually little reason to adjust this
|
|
Packit |
90a5c9 |
parameter.
|
|
Packit |
90a5c9 |
|
|
Packit |
90a5c9 |
For mpm_netware the default is
|
|
Packit |
90a5c9 |
StartThreads 50 and, since there is only a single
|
|
Packit |
90a5c9 |
process, this is the total number of threads created at startup to
|
|
Packit |
90a5c9 |
serve requests.
|
|
Packit |
90a5c9 |
|
|
Packit |
90a5c9 |
|
|
Packit |
90a5c9 |
|
|
Packit |
90a5c9 |
|
|
Packit |
90a5c9 |
|
|
Packit |
90a5c9 |
Description:Sets the upper limit on the configurable number of threads
|
|
Packit |
90a5c9 |
per child process
|
|
Packit |
90a5c9 |
Syntax:ThreadLimit number
|
|
Packit |
90a5c9 |
Default:See usage for details
|
|
Packit |
90a5c9 |
Context:server config
|
|
Packit |
90a5c9 |
Status:MPM
|
|
Packit |
90a5c9 |
Module:event , worker , mpm_winnt
|
|
Packit |
90a5c9 |
|
|
Packit |
90a5c9 |
This directive sets the maximum configured value for ThreadsPerChild for the lifetime
|
|
Packit |
90a5c9 |
of the Apache httpd process. Any attempts to change this directive
|
|
Packit |
90a5c9 |
during a restart will be ignored, but ThreadsPerChild can be modified
|
|
Packit |
90a5c9 |
during a restart up to the value of this directive.
|
|
Packit |
90a5c9 |
|
|
Packit |
90a5c9 |
Special care must be taken when using this directive. If
|
|
Packit |
90a5c9 |
ThreadLimit is set to a value much higher
|
|
Packit |
90a5c9 |
than ThreadsPerChild ,
|
|
Packit |
90a5c9 |
extra unused shared memory will be allocated. If both
|
|
Packit |
90a5c9 |
ThreadLimit and ThreadsPerChild are set to values
|
|
Packit |
90a5c9 |
higher than the system can handle, Apache httpd may not start or the
|
|
Packit |
90a5c9 |
system may become unstable. Do not set the value of this directive
|
|
Packit |
90a5c9 |
any higher than your greatest predicted setting of ThreadsPerChild for the
|
|
Packit |
90a5c9 |
current run of Apache httpd.
|
|
Packit |
90a5c9 |
|
|
Packit |
90a5c9 |
The default value for ThreadLimit is
|
|
Packit |
90a5c9 |
1920 when used with mpm_winnt and
|
|
Packit |
90a5c9 |
64 when used with the others.
|
|
Packit |
90a5c9 |
|
|
Packit |
90a5c9 |
Note
|
|
Packit |
90a5c9 |
There is a hard limit of ThreadLimit 20000 (or
|
|
Packit |
90a5c9 |
ThreadLimit 100000 with event ,
|
|
Packit |
90a5c9 |
ThreadLimit 15000 with mpm_winnt )
|
|
Packit |
90a5c9 |
compiled into the server. This is intended to avoid nasty effects
|
|
Packit |
90a5c9 |
caused by typos. To increase it even further past this limit, you
|
|
Packit |
90a5c9 |
will need to modify the value of MAX_THREAD_LIMIT in the mpm
|
|
Packit |
90a5c9 |
source file and rebuild the server.
|
|
Packit |
90a5c9 |
|
|
Packit |
90a5c9 |
|
|
Packit |
90a5c9 |
|
|
Packit |
90a5c9 |
|
|
Packit |
90a5c9 |
|
|
Packit |
90a5c9 |
|
|
Packit |
90a5c9 |
Description:Number of threads created by each child process
|
|
Packit |
90a5c9 |
Syntax:ThreadsPerChild number
|
|
Packit |
90a5c9 |
Default:See usage for details
|
|
Packit |
90a5c9 |
Context:server config
|
|
Packit |
90a5c9 |
Status:MPM
|
|
Packit |
90a5c9 |
Module:event , worker , mpm_winnt
|
|
Packit |
90a5c9 |
|
|
Packit |
90a5c9 |
This directive sets the number of threads created by each
|
|
Packit |
90a5c9 |
child process. The child creates these threads at startup and
|
|
Packit |
90a5c9 |
never creates more. If using an MPM like mpm_winnt ,
|
|
Packit |
90a5c9 |
where there is only one child process, this number should be high
|
|
Packit |
90a5c9 |
enough to handle the entire load of the server. If using an MPM
|
|
Packit |
90a5c9 |
like worker , where there are multiple child processes,
|
|
Packit |
90a5c9 |
the total number of threads should be high enough to handle
|
|
Packit |
90a5c9 |
the common load on the server.
|
|
Packit |
90a5c9 |
|
|
Packit |
90a5c9 |
The default value for ThreadsPerChild is
|
|
Packit |
90a5c9 |
64 when used with mpm_winnt and
|
|
Packit |
90a5c9 |
25 when used with the others.
|
|
Packit |
90a5c9 |
|
|
Packit |
90a5c9 |
|
|
Packit |
90a5c9 |
|
|
Packit |
90a5c9 |
|
|
Packit |
90a5c9 |
|
|
Packit |
90a5c9 |
Description:The size in bytes of the stack used by threads handling
|
|
Packit |
90a5c9 |
client connections
|
|
Packit |
90a5c9 |
Syntax:ThreadStackSize size
|
|
Packit |
90a5c9 |
Default:65536 on NetWare; varies on other operating systems
|
|
Packit |
90a5c9 |
Context:server config
|
|
Packit |
90a5c9 |
Status:MPM
|
|
Packit |
90a5c9 |
Module:event , worker , mpm_winnt , mpm_netware , mpmt_os2
|
|
Packit |
90a5c9 |
Compatibility:Available in Apache HTTP Server 2.1 and later
|
|
Packit |
90a5c9 |
|
|
Packit |
90a5c9 |
The ThreadStackSize directive sets the
|
|
Packit |
90a5c9 |
size of the stack (for autodata) of threads which handle client
|
|
Packit |
90a5c9 |
connections and call modules to help process those connections.
|
|
Packit |
90a5c9 |
In most cases the operating system default for stack size is
|
|
Packit |
90a5c9 |
reasonable, but there are some conditions where it may need to be
|
|
Packit |
90a5c9 |
adjusted:
|
|
Packit |
90a5c9 |
|
|
Packit |
90a5c9 |
|
|
Packit |
90a5c9 |
On platforms with a relatively small default thread stack size
|
|
Packit |
90a5c9 |
(e.g., HP-UX), Apache httpd may crash when using some third-party modules
|
|
Packit |
90a5c9 |
which use a relatively large amount of autodata storage. Those
|
|
Packit |
90a5c9 |
same modules may have worked fine on other platforms where the
|
|
Packit |
90a5c9 |
default thread stack size is larger. This type of crash is
|
|
Packit |
90a5c9 |
resolved by setting ThreadStackSize to a
|
|
Packit |
90a5c9 |
value higher than the operating system default. This type of
|
|
Packit |
90a5c9 |
adjustment is necessary only if the provider of the third-party
|
|
Packit |
90a5c9 |
module specifies that it is required, or if diagnosis of an Apache httpd
|
|
Packit |
90a5c9 |
crash indicates that the thread stack size was too small.
|
|
Packit |
90a5c9 |
|
|
Packit |
90a5c9 |
On platforms where the default thread stack size is
|
|
Packit |
90a5c9 |
significantly larger than necessary for the web server
|
|
Packit |
90a5c9 |
configuration, a higher number of threads per child process
|
|
Packit |
90a5c9 |
will be achievable if ThreadStackSize is
|
|
Packit |
90a5c9 |
set to a value lower than the operating system default. This type
|
|
Packit |
90a5c9 |
of adjustment should only be made in a test environment which allows
|
|
Packit |
90a5c9 |
the full set of web server processing can be exercised, as there
|
|
Packit |
90a5c9 |
may be infrequent requests which require more stack to process.
|
|
Packit |
90a5c9 |
The minimum required stack size strongly depends on the modules
|
|
Packit |
90a5c9 |
used, but any change in the web server configuration can invalidate
|
|
Packit |
90a5c9 |
the current ThreadStackSize setting.
|
|
Packit |
90a5c9 |
|
|
Packit |
90a5c9 |
On Linux, this directive can only be used to increase the default
|
|
Packit |
90a5c9 |
stack size, as the underlying system call uses the value as a
|
|
Packit |
90a5c9 |
minimum stack size. The (often large) soft limit for
|
|
Packit |
90a5c9 |
ulimit -s (8MB if unlimited) is used as the default stack
|
|
Packit |
90a5c9 |
size.
|
|
Packit |
90a5c9 |
|
|
Packit |
90a5c9 |
|
|
Packit |
90a5c9 |
It is recommended to not reduce ThreadStackSize
|
|
Packit |
90a5c9 |
unless a high number of threads per child process is needed. On some
|
|
Packit |
90a5c9 |
platforms (including Linux), a setting of 128000 is already too low and
|
|
Packit |
90a5c9 |
causes crashes with some common modules.
|
|
Packit |
90a5c9 |
|
|
Packit |
90a5c9 |
|
|
Packit |
90a5c9 |
|
|
Packit |
90a5c9 |
|
|
Packit |
90a5c9 |
Available Languages: de |
|
|
Packit |
90a5c9 |
en |
|
|
Packit |
90a5c9 |
fr |
|
|
Packit |
90a5c9 |
ja |
|
|
Packit |
90a5c9 |
tr
|
|
Packit |
90a5c9 |
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.
|
|
Packit |
90a5c9 |
<script type="text/javascript">
|
|
Packit |
90a5c9 |
var comments_shortname = 'httpd';
|
|
Packit |
90a5c9 |
var comments_identifier = 'http://httpd.apache.org/docs/2.4/mod/mpm_common.html';
|
|
Packit |
90a5c9 |
(function(w, d) {
|
|
Packit |
90a5c9 |
if (w.location.hostname.toLowerCase() == "httpd.apache.org") {
|
|
Packit |
90a5c9 |
d.write('
|
|
Packit |
90a5c9 |
var s = d.createElement('script');
|
|
Packit |
90a5c9 |
s.type = 'text/javascript';
|
|
Packit |
90a5c9 |
s.async = true;
|
|
Packit |
90a5c9 |
s.src = 'https://comments.apache.org/show_comments.lua?site=' + comments_shortname + '&page=' + comments_identifier;
|
|
Packit |
90a5c9 |
(d.getElementsByTagName('head')[0] || d.getElementsByTagName('body')[0]).appendChild(s);
|
|
Packit |
90a5c9 |
}
|
|
Packit |
90a5c9 |
else {
|
|
Packit |
90a5c9 |
d.write('
|
|
Packit |
90a5c9 |
}
|
|
Packit |
90a5c9 |
})(window, document);
|
|
Packit |
90a5c9 |
//--></script>
|
|
Packit |
90a5c9 |
Copyright 2018 The Apache Software Foundation. Licensed under the Apache License, Version 2.0.
|
|
Packit |
90a5c9 |
Modules | Directives | FAQ | Glossary | Sitemap <script type="text/javascript">
|
|
Packit |
90a5c9 |
if (typeof(prettyPrint) !== 'undefined') {
|
|
Packit |
90a5c9 |
prettyPrint();
|
|
Packit |
90a5c9 |
}
|
|
Packit |
90a5c9 |
//--></script>
|
|
Packit |
90a5c9 |
</body></html>
|