Httpd worker MPM Configuration: Difference between revisions

From NovaOrdis Knowledge Base
Jump to navigation Jump to search
No edit summary
Line 33: Line 33:
"MaxClients" and "MaxRequestWorkers" are equivalent, since 2.3.13 "MaxClients" was renamed "MaxRequestWorkers", but for the time being, both names are valid and supported.
"MaxClients" and "MaxRequestWorkers" are equivalent, since 2.3.13 "MaxClients" was renamed "MaxRequestWorkers", but for the time being, both names are valid and supported.


[[#MaxClients|MaxClients]] represents the maximum number of connections that will be processed simultaneously ''by the entire server'', seen as the sum of all active children processes. The default value is 400 = 16 ([[#ServerLimit|ServerLimit]]) * 25 ([[#ThreadsPerChild|ThreadsPerChild]]). The directive restricts the total number of threads that will be available to serve clients.
[[#MaxClients.2C_MaxRequestWorkers|MaxClients]] represents the maximum number of connections that will be processed simultaneously ''by the entire server'', seen as the sum of all active children processes. The default value is 400 = 16 ([[#ServerLimit|ServerLimit]]) * 25 ([[#ThreadsPerChild|ThreadsPerChild]]). The directive restricts the total number of threads that will be available to serve clients.


Any connection attempts over the [[#MaxClients|MaxClients]] limit will normally be queued, up to a number based on the [[#ListenBacklog|ListenBacklog]] directive. Once a child process becomes available after handling at least one of its current requests, the connection will then be serviced.
Any connection attempts over the [[#MaxClients.2C_MaxRequestWorkers|MaxClients]] limit will normally be queued, up to a number based on the [[#ListenBacklog|ListenBacklog]] directive. Once a child process becomes available after handling at least one of its current requests, the connection will then be serviced.


Even if [[#ServerLimit|ServerLimit]] is set to a high value ([[#ThreadsPerChild|ThreadsPerChild]] left to default), the number of concurrent connection ''is'' limited by [[#MaxClients|MaxClients]]. This was tested and proven.
Even if [[#ServerLimit|ServerLimit]] is set to a high value ([[#ThreadsPerChild|ThreadsPerChild]] left to default), the number of concurrent connection ''is'' limited by [[#MaxClients.2C_MaxRequestWorkers|MaxClients]]. This was tested and proven.


==MaxClients Idiosyncrasies==
==MaxClients Idiosyncrasies==


* [[#MaxClients|MaxClients]] must be at least equals with [[#ThreadsPerChild|ThreadsPerChild]]. If not, httpd will warn at startup and automatically adjust the value to be equals with [[#ThreadsPerChild|ThreadsPerChild]].
* [[#MaxClients.2C_MaxRequestWorkers|MaxClients]] must be at least equals with [[#ThreadsPerChild|ThreadsPerChild]]. If not, httpd will warn at startup and automatically adjust the value to be equals with [[#ThreadsPerChild|ThreadsPerChild]].
* [[#MaxClients|MaxClients]] must be an integer multiple of [[#ThreadsPerChild|ThreadsPerChild]]. If it's not, it will be adjusted automatically, and the server will issue an error message similar to the one presented below:
* [[#MaxClients.2C_MaxRequestWorkers|MaxClients]] must be an integer multiple of [[#ThreadsPerChild|ThreadsPerChild]]. If it's not, it will be adjusted automatically, and the server will issue an error message similar to the one presented below:


<pre>
<pre>

Revision as of 02:30, 2 January 2017

Internal

Overview

worker MPM Concepts

Diagram

The configuration elements described below are represented on the mod_jk Concepts Diagram.

Enabling woker MPM Mode

If you configure httpd yourself, make sure you compiled it with worker MPM support.

If you use Red Hat EWS, worker support comes pre-compiled into $APACHE_HOME/sbin/httpd.worker, make sure the start script is using that.

For more details about compiling httpd with the right MPM mode, see:

woker MPM Compilation

MaxClients, MaxRequestWorkers

"MaxClients" and "MaxRequestWorkers" are equivalent, since 2.3.13 "MaxClients" was renamed "MaxRequestWorkers", but for the time being, both names are valid and supported.

MaxClients represents the maximum number of connections that will be processed simultaneously by the entire server, seen as the sum of all active children processes. The default value is 400 = 16 (ServerLimit) * 25 (ThreadsPerChild). The directive restricts the total number of threads that will be available to serve clients.

Any connection attempts over the MaxClients limit will normally be queued, up to a number based on the ListenBacklog directive. Once a child process becomes available after handling at least one of its current requests, the connection will then be serviced.

Even if ServerLimit is set to a high value (ThreadsPerChild left to default), the number of concurrent connection is limited by MaxClients. This was tested and proven.

MaxClients Idiosyncrasies

  • MaxClients must be at least equals with ThreadsPerChild. If not, httpd will warn at startup and automatically adjust the value to be equals with ThreadsPerChild.
  • MaxClients must be an integer multiple of ThreadsPerChild. If it's not, it will be adjusted automatically, and the server will issue an error message similar to the one presented below:
MaxClients (12) is not an integer multiple of ThreadsPerChild (10), lowering MaxClients to 10

ThreadsPerChild

StartServers

MinSpareThreads

MaxSpareThreads

ServerLimit

ThreadLimit

ListenBacklog