title: Apache: how to setup in Apache/mod_proxy an upper bound on the number of concurrent forwarded requests?
body: <p>I have a fairly standard setup where a front-end Apache server forwards requests to Tomcat through mod_proxy/AJP. How can I setup Apache/mod_proxy so it only forwards at most N (say, N=4) concurrent requests to Tomcat? Other concurrent requests coming into Apache should not be rejected, and should instead be queued to later be sent to Tomcat.</p>
  
  <p>PS 1: Note that this is something you can do this at Tomcat level with the <code>maxThreads</code> attribute, but I prefer to handle this at the Apache level.</p>
  
  <p>PS 2: I see that Apache has a <a href="http://httpd.apache.org/docs/2.2/mod/mpm_common.html#maxclients" rel="nofollow noreferrer">MaxClients</a> configuration, which seems to be doing what I am looking for. But it is not clear to me how to have a MaxClient per server mod_proxy forwards to, rather than MaxClient per Apache. I.e. if Apache forward requests to a cluster of 4 Tomcat machine, I'd like Apache to limit the number of concurrent requests forwarded to any given Tomcat to N (say, N=4).</p>