Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>The solutions is mod_proxy by adding parameters to <a href="http://httpd.apache.org/docs/current/mod/mod_proxy.html#proxypass" rel="nofollow">ProxyPass</a> directives. What you want to set is probably the <em>max</em>. This however will throw an error instantly and not queue your requests when you hit the <em>max</em>.</p> <p>If you really want to queue you have to use also mod_proxy_balancer. For example allow maximum 4 connections:</p> <pre><code>ProxyPass / balancer://appservers/ stickysession=JSESSIONID|jsessionid nofailover=On &lt;Proxy balancer://appservers&gt; BalancerMember ajp://192.168.0.100:8009 max=4 BalancerMember ajp://192.168.0.101:8009 max=4 BalancerMember ajp://192.168.0.102:8009 max=4 BalancerMember ajp://192.168.0.103:8009 max=4 &lt;/Proxy&gt; </code></pre> <p>Unfortunately, with in Apache, the value of <code>max</code> is per process. So, you can only effectively limit the number of connections to your back-end servers if Apache has one process and uses threads instead of processes to handle multiple connections, which depends on what <a href="http://httpd.apache.org/docs/2.2/mpm.html" rel="nofollow">MPM</a> is being used by Apache:</p> <ul> <li><strong>On Windows</strong>, you should be all good and most likely don't have to worry about this, as the <a href="http://httpd.apache.org/docs/2.2/mod/mpm_winnt.html" rel="nofollow">winnt MPM</a> uses one process which in turn creates threads to handle requests.</li> <li><p><strong>On UNIX</strong>, if you're using the Apache that came with your OS, unfortunately there is a good chance you have <a href="http://httpd.apache.org/docs/2.1/mod/prefork.html" rel="nofollow">prefork MPM</a> Apache, which creates one process per request, and with which the max parameter wouldn't work:</p> <ol> <li>To check what MPM you have, run <code>apachectl -l</code>.</li> <li>In the list, if you see <code>worker.c</code> or <code>event.c</code>, then you are almost good: you now just need to make sure that Apache creates only one process. For this, set <code>ThreadsPerChild</code> and <code>MaxClients</code> to the same value, which will be the total number of concurrent connections your Apache will be able to process. Also set <code>ServerLimit</code> to 1.</li> <li>In the list, if you see <code>prefork.c</code>, then you first need to replace your Apache with the worker or event MPM Apache. You can do so by either recompiling Apache yourself (the MPM is not a run-time configuration parameter), or getting a existing package for your platform. Then, go to step two.</li> </ol></li> </ul>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload