title: What is the difference between maxActive vs. maxIdle for Tomcat connection pools?
body: <p>The tomcat connection pool has a setting called maxActive and a setting called maxIdle my questions are.  </p>
  
  <ol>
  <li>What is the difference between these two settings? </li>
  <li>What is a real world example scenario where you might have a different value for maxActive than you would for maxIdle? </li>
  </ol>
  
  <p>For some reason the docs are not making sense to me. maxActive and maxIdle exist on both the apache dbcp and the tomact 7 jdbc-pool according to the docs at 
  <a href="http://tomcat.apache.org/tomcat-7.0-doc/jdbc-pool.html" rel="noreferrer">http://tomcat.apache.org/tomcat-7.0-doc/jdbc-pool.html</a> </p>
  
  <blockquote>
    <p>maxActive  (int) The maximum number of active connections that can be
    allocated from this pool at the same time. The default value is 100</p>
    
    <p>maxIdle    (int) The maximum number of connections that should be kept
    in the pool at all times. Default value is maxActive:100 Idle
    connections are checked periodically (if enabled) and connections that
    been idle for longer than minEvictableIdleTimeMillis will be released.
    (also see testWhileIdle)</p>
  </blockquote>