</ul>
<p>This directive can be used to fine-tune the per-process connection
- limit. A process will only accept new connections if the current number of
+ limit. A <strong>process</strong> will only accept new connections if the current number of
connections (not counting connections in the "closing" state) is lower
than:</p>
<var>number of idle workers</var>)
</strong></p>
- <note><title>Idle connections handled by each process</title>
- <highlight language="config">
+ <p>An estimation of the maximum concurrent connections across all the processes given
+ an average value of idle worker threads can be calculated with:
+ </p>
-max_connections = ThreadsPerChild + (AsyncRequestWorkerFactor * idle_workers)
-ThreadsPerChild = idle_workers + busy_workers
-
-max_connections = (idle_workers + busy_workers) + (AsyncRequestWorkerFactor * idle_workers)
- = busy_workers + (AsyncRequestWorkerFactor + 1) * idle_workers
+ <p class="indent"><strong>
+ (<directive module="mpm_common">ThreadsPerChild</directive> +
+ (<directive>AsyncRequestWorkerFactor</directive> *
+ <var>number of idle workers</var>)) *
+ <directive module="mpm_common">ServerLimit</directive>
+ </strong></p>
-max_connections = max_idle_connections + busy_workers
+ <note><title>Example</title>
+ <highlight language="config">
-max_idle_connections + busy_workers =
- busy_workers + (AsyncRequestWorkerFactor + 1) * idle_workers
+ThreadsPerChild = 10
+ServerLimit = 4
+AsyncRequestWorkerFactor = 2
+MaxRequestWorkers = 40
-max_idle_connections = (AsyncRequestWorkerFactor + 1) * idle_workers
+idle_workers = 4 (average for all the processes to keep it simple)
+max_connections = (ThreadsPerChild + (AsyncRequestWorkerFactor * idle_workers)) * ServerLimit
+ = (10 + (2 * 4)) * 4 = 72
+
</highlight>
</note>
- <p>The absolute maximum numbers of concurrent connections is:</p>
+ <p>When all the worker threads are idle, then absolute maximum numbers of concurrent
+ connections can be calculared in a simpler way:</p>
<p class="indent"><strong>
(<directive>AsyncRequestWorkerFactor</directive> + 1) *
</strong></p>
- <note><title>Example 1</title>
+ <note><title>Example</title>
<highlight language="config">
ThreadsPerChild = 10
</highlight>
</note>
- <p>The above example is only related to a theoretical maximum, let's take a look to a more common use case:</p>
-
- <note><title>Example 2</title>
- <highlight language="config">
-
-ThreadsPerChild = 10
-ServerLimit = 4
-AsyncRequestWorkerFactor = 2
-MaxRequestWorkers = 40
-
-idle_workers = 4 (average for all the processes to keep it simple)
-
-max_connections = (ThreadsPerChild + (AsyncRequestWorkerFactor * idle_workers)) * ServerLimit
- = (10 + (2 * 4)) * 4 = 72
-
- </highlight>
- </note>
-
<p>Tuning <directive>AsyncRequestWorkerFactor</directive> requires knowledge about the traffic handled by httpd in each specific use case, so changing the default value requires extensive testing and data gathering from <module>mod_status</module>.</p>
<p><directive module="mpm_common">MaxRequestWorkers</directive> was called