]> git.ipfire.org Git - thirdparty/apache/httpd.git/commitdiff
Clarify some mod_proxy concepts in the docs
authorLuca Toscano <elukey@apache.org>
Thu, 27 Jul 2017 12:30:20 +0000 (12:30 +0000)
committerLuca Toscano <elukey@apache.org>
Thu, 27 Jul 2017 12:30:20 +0000 (12:30 +0000)
I have recently got some basic mod-proxy concepts
and these simple info would have helped me a lot:

- connection pooling == reuse. My brain did not pick
  up this simple nomenclature at first read for some
  reason, probably because we have parameters called
  "*reuse*" and not "*pooling*". I find the term
  "reuse" clearer than "pooling", but this is
  debatable :)
- the concept of "Worker" needs to be read before
  the ProxyPass section (that people probably read
  directly after checking a search engine) to fully
  understand its power.
- the fact that a worker is related to a single process
  (and not shared as a Balancer) is a really important
  concept that I tried to highlight when talking
  about maxconns (question popped up a lot of times
  from users).

Hope that my understanding is correct, feedback is welcome.

git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1803171 13f79535-47bb-0310-9956-ffa450edef68

docs/manual/mod/mod_proxy.html.en
docs/manual/mod/mod_proxy.xml
docs/manual/mod/mod_proxy_fcgi.html.en
docs/manual/mod/mod_proxy_fcgi.xml
docs/manual/rewrite/flags.html.en
docs/manual/rewrite/flags.xml

index c85ae87cac7d9a8f306c7c490ee1da0a44506b75..48ec97314bc07d1d3d521fe93e38eef83b109be5 100644 (file)
@@ -244,7 +244,7 @@ ProxyVia On
 
       <p>The two default workers have a fixed configuration
       and will be used if no other worker matches the request.
-      They do not use HTTP Keep-Alive or connection pooling.
+      They do not use HTTP Keep-Alive or connection reuse.
       The TCP connections to the origin server will instead be
       opened and closed for each request.</p>
 
@@ -345,8 +345,8 @@ ProxyPass "/examples" "http://backend.example.com/examples" timeout=10</pre>
       <div class="note"><h3>DNS resolution for origin domains</h3>
       <p>DNS resolution happens when the socket to
         the origin domain is created for the first time.
-        When connection pooling is used, each backend domain is resolved 
-        only once per child process, and reused for all further connections 
+        When connection reuse is enabled, each backend domain is resolved 
+        only once per child process, and cached for all further connections 
         until the child is recycled. This information should to be considered 
         while planning DNS maintenance tasks involving backend domains. 
         Please also check <code class="directive"><a href="#proxypass">ProxyPass</a></code>
@@ -1020,7 +1020,11 @@ through</td></tr>
     a local virtual path; <var>url</var> is a partial URL for the
     remote server and cannot include a query string.</p>
 
-    <div class="note"><strong>Note: </strong>This directive is not supported within
+    <div class="note">It is strongly suggested to review the concept of a
+    <a href="#workers">Worker</a> before proceeding any further
+    with this section.</div>
+
+    <div class="note">This directive is not supported within
     <code class="directive"><a href="../mod/core.html#directory">&lt;Directory&gt;</a></code> and
     <code class="directive"><a href="../mod/core.html#files">&lt;Files&gt;</a></code> containers.</div>
 
@@ -1133,24 +1137,26 @@ ProxyPass "/mirror/foo"   "http://backend.example.com"</pre>
     using  <code>key=value</code> parameters, described in the tables
     below.</p>
 
+    <div class="warning"><h3>Maximum connections to the backend</h3>
     <p>By default, mod_proxy will allow and retain the maximum number of
     connections that could be used simultaneously by that web server child
     process.  Use the <code>max</code> parameter to reduce the number from
-    the default.  Use the <code>ttl</code> parameter to set an optional
+    the default. The pool of connections is maintained per web server child
+    process, and <code>max</code> and other settings are not coordinated
+    among all child processes, except when only one child process is allowed
+    by configuration or MPM design.</p>
+    </div>
+
+    <p>Use the <code>ttl</code> parameter to set an optional
     time to live; connections which have been unused for at least
     <code>ttl</code> seconds will be closed.  <code>ttl</code> can be used
     to avoid using a connection which is subject to closing because of the
     backend server's keep-alive timeout.</p>
 
-    <p>The pool of connections is maintained per web server child
-    process, and <code>max</code> and other settings are not coordinated
-    among all child processes, except when only one child process is allowed
-    by configuration or MPM design.</p>
-
     <div class="example"><h3>Example</h3><pre class="prettyprint lang-config">ProxyPass "/example" "http://backend.example.com" max=20 ttl=120 retry=300</pre>
 </div>
 
-    <table class="bordered"><tr><th>BalancerMember parameters</th></tr></table>
+    <table class="bordered"><tr><th>Worker|BalancerMember parameters</th></tr></table>
     <table>
     <tr><th>Parameter</th>
         <th>Default</th>
@@ -1201,7 +1207,7 @@ ProxyPass "/mirror/foo"   "http://backend.example.com"</pre>
     httpd and
     the backend server (regardless of protocol) tends to silently
     drop connections or when backends themselves may be under round-
-    robin DNS. To disable connection pooling reuse,
+    robin DNS. To disable connection reuse,
     set this property value to <code>On</code>.
     </td></tr>
     <tr><td>enablereuse</td>
index a97abc36d9fcb7e866b74957c81f6340c2b3f0c9..3c1b49b3e6494d818f541935bd245697b6a87452 100644 (file)
@@ -201,7 +201,7 @@ ProxyVia On
 
       <p>The two default workers have a fixed configuration
       and will be used if no other worker matches the request.
-      They do not use HTTP Keep-Alive or connection pooling.
+      They do not use HTTP Keep-Alive or connection reuse.
       The TCP connections to the origin server will instead be
       opened and closed for each request.</p>
 
@@ -307,8 +307,8 @@ ProxyPass "/examples" "http://backend.example.com/examples" timeout=10
       <note><title>DNS resolution for origin domains</title>
       <p>DNS resolution happens when the socket to
         the origin domain is created for the first time.
-        When connection pooling is used, each backend domain is resolved 
-        only once per child process, and reused for all further connections 
+        When connection reuse is enabled, each backend domain is resolved 
+        only once per child process, and cached for all further connections 
         until the child is recycled. This information should to be considered 
         while planning DNS maintenance tasks involving backend domains. 
         Please also check <directive module="mod_proxy">ProxyPass</directive>
@@ -881,7 +881,11 @@ expressions</description>
     a local virtual path; <var>url</var> is a partial URL for the
     remote server and cannot include a query string.</p>
 
-    <note><strong>Note: </strong>This directive is not supported within
+    <note>It is strongly suggested to review the concept of a
+    <a href="#workers">Worker</a> before proceeding any further
+    with this section.</note>
+
+    <note>This directive is not supported within
     <directive type="section" module="core">Directory</directive> and
     <directive type="section" module="core">Files</directive> containers.</note>
 
@@ -1002,27 +1006,29 @@ ProxyPass "/mirror/foo"   "http://backend.example.com"
     using  <code>key=value</code> parameters, described in the tables
     below.</p>
 
+    <note type="warning"><title>Maximum connections to the backend</title>
     <p>By default, mod_proxy will allow and retain the maximum number of
     connections that could be used simultaneously by that web server child
     process.  Use the <code>max</code> parameter to reduce the number from
-    the default.  Use the <code>ttl</code> parameter to set an optional
+    the default. The pool of connections is maintained per web server child
+    process, and <code>max</code> and other settings are not coordinated
+    among all child processes, except when only one child process is allowed
+    by configuration or MPM design.</p>
+    </note>
+
+    <p>Use the <code>ttl</code> parameter to set an optional
     time to live; connections which have been unused for at least
     <code>ttl</code> seconds will be closed.  <code>ttl</code> can be used
     to avoid using a connection which is subject to closing because of the
     backend server's keep-alive timeout.</p>
 
-    <p>The pool of connections is maintained per web server child
-    process, and <code>max</code> and other settings are not coordinated
-    among all child processes, except when only one child process is allowed
-    by configuration or MPM design.</p>
-
     <example><title>Example</title>
         <highlight language="config">
 ProxyPass "/example" "http://backend.example.com" max=20 ttl=120 retry=300
         </highlight>
     </example>
 
-    <table border="2"><tr><th>BalancerMember parameters</th></tr></table>
+    <table border="2"><tr><th>Worker|BalancerMember parameters</th></tr></table>
     <table>
     <tr><th>Parameter</th>
         <th>Default</th>
@@ -1073,7 +1079,7 @@ ProxyPass "/example" "http://backend.example.com" max=20 ttl=120 retry=300
     httpd and
     the backend server (regardless of protocol) tends to silently
     drop connections or when backends themselves may be under round-
-    robin DNS. To disable connection pooling reuse,
+    robin DNS. To disable connection reuse,
     set this property value to <code>On</code>.
     </td></tr>
     <tr><td>enablereuse</td>
index 1e4982427062c72c47ab6540950939eb782e4db5..df117bee926c2be941007dafcd444ea805e372a6 100644 (file)
@@ -95,7 +95,7 @@
     <p> The following example passes the request URI as a filesystem
     path for the PHP-FPM daemon to run. The request URL is implicitly added
     to the 2nd parameter. The hostname and port following fcgi:// are where
-    PHP-FPM is listening.  Connection pooling is enabled.</p>
+    PHP-FPM is listening.  Connection pooling/reuse is enabled.</p>
     <div class="example"><h3>PHP-FPM</h3><pre class="prettyprint lang-config">ProxyPassMatch "^/myapp/.*\.php(/.*)?$" "fcgi://localhost:9000/var/www/" enablereuse=on</pre>
 </div>
 
index 4bc227d18fd54eb21f3b39737899d3e137758ffd..f63e3985d7500c9885cbb07b5e4b953da5c642cc 100644 (file)
@@ -85,7 +85,7 @@ ProxyPass "/myapp/" "fcgi://localhost:4000/" enablereuse=on
     <p> The following example passes the request URI as a filesystem
     path for the PHP-FPM daemon to run. The request URL is implicitly added
     to the 2nd parameter. The hostname and port following fcgi:// are where
-    PHP-FPM is listening.  Connection pooling is enabled.</p>
+    PHP-FPM is listening.  Connection pooling/reuse is enabled.</p>
     <example><title>PHP-FPM</title>
     <highlight language="config">
 ProxyPassMatch "^/myapp/.*\.php(/.*)?$" "fcgi://localhost:9000/var/www/" enablereuse=on
index d2621ba7c4ad85e82bb54370c1f8f6fcbd019ffb..722e6462c9921f0cbb4ef076c0ea0dc7c294c4a0 100644 (file)
@@ -536,7 +536,7 @@ client undue influence.</p>
 <p>Using this flag triggers the use of <code class="module"><a href="../mod/mod_proxy.html">mod_proxy</a></code>, without handling of persistent connections. This
 means the performance of your proxy will be better if you set it up with <code class="directive"><a href="../mod/mod_proxy.html#proxypass">ProxyPass</a></code> or
 <code class="directive"><a href="../mod/mod_proxy.html#proxypassmatch">ProxyPassMatch</a></code></p>
-<p>This is because this flag triggers the use of the default worker, which does not handle connection pooling.</p>
+<p>This is because this flag triggers the use of the default worker, which does not handle connection pooling/reuse.</p>
 <p>Avoid using this flag and prefer those directives, whenever you can.</p>
 </div>
 
index 3c7aceef3e1e7c31a20e7226d25a34456cd02291..cd9fe971caf6ed520b9bf854fde121c769385d76 100644 (file)
@@ -547,7 +547,7 @@ client undue influence.</p>
 <p>Using this flag triggers the use of <module>mod_proxy</module>, without handling of persistent connections. This
 means the performance of your proxy will be better if you set it up with <directive module="mod_proxy">ProxyPass</directive> or
 <directive module="mod_proxy">ProxyPassMatch</directive></p>
-<p>This is because this flag triggers the use of the default worker, which does not handle connection pooling.</p>
+<p>This is because this flag triggers the use of the default worker, which does not handle connection pooling/reuse.</p>
 <p>Avoid using this flag and prefer those directives, whenever you can.</p>
 </note>