title: Is there ever a reason to set maxIdle > maxActive for connection pools?
body: <p>I'm just learning about connection pools, and I was wondering if there's ever any reason to set <code>maxIdle</code> > <code>maxActive</code>.</p>
  
  <p>This is my understanding:</p>
  
  <p>Idle connections are connections that have been created and are waiting to be used.
  It becomes an active connection once a client borrows it.</p>
  
  <p><code>minIdle</code> determines the number of initial connections to create in a pool. </p>
  
  <p>When a client tries to use the pool, an idle connection is given. If there are no available idle connections, the pool will create one. When an idle connection becomes an active connection, if the number of idle connections fall below <code>minIdle</code>, the pool will create connections until there are at least <code>minIdle</code> idle connections. When a client is finished with an active connection, the connection becomes an idle connection again.</p>
  
  <p>This means the number of idle connections can grow, so <code>maxIdle</code> prevents the connection pool from having too many idle connections. Since <code>maxActive</code> caps the number of connections that can be borrowed, there is no need to have a <code>maxIdle</code> > <code>maxActive</code>.</p>