Problem Description: LDAP server suspended new connections due to Spring LDAP Template pool created so many connections in a short period of time. After a while, LDAP server resumed serving requests normally.
Background of the Problem:
We have below setting in our app minEvictableIdleTimeMillis = 90000 timeBetweenEvictionRunsMillis = 15000 So, every 15 seconds, the pool scans for idle connections, and evicts those that have been idle for 90+ seconds.
Under high traffic, application is actively being used and there are no/very less idle connections, pooling settings are working. But during idle scenarios, new connections are keep on getting created even beyond defined total no. of connections.
But if we keep testWhileIdle=false or timeBetweenEvictionRunsMillis is -1 then pooling works even in low traffic. What we are missing? testOnBorrow is true. What can be a problem here?
org.springframework.ldap. Internally Apache Commons Pool is being used which should call destroy Object. The fact that there are 70 TCP/IP connections (that is the netstat thing) doesn't mean there are 70 active connections in the pool.