0

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?

4
  • I doubt it creates more connections then the total you specified. I suspect your periods are too small for the LDAP server and you churn through your allowed created connections in a said timeframe. So contact the maintainers of your LDAP server and figure out the right numbers. Commented Jun 19 at 14:20
  • LDAP server(with timeout=300secs) netstat shows no. of connections increasing beyond 70 which all are in ESTABLISHED state, when the max total is only 30 connections. We are using default context validator and because we are using testonborrow hence the validation works. FW could be silently dropping but from spring debug logs we could see the active no. of connections are increasing even for 1 request after being idle. Issue is similar to link Commented Jun 19 at 15:08
  • ibm.com/support/pages/… Commented Jun 19 at 15:09
  • I would suggest aligning the timeouts/idle settings withyour server. What do you see in the logs when you enable DEBUG logging for 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. Commented Jun 20 at 10:16

1 Answer 1

0

We figured out that it was due to memory leak in Apache commons library (probably 1.6x) and spring 2.4.x was using it because of imports in our code. After we made code changes for spring imports using pool2, it started working.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.