Increasing the JDBC connection pool size
In the event of performing load and stress tests on OpenIAM with OpenIAM API /idp/rest/api/auth/public/login
, you might run into an error indicating the pool size for connector is too small.
Problem
For instance, you use 4 rProxys that balance their respective openiam-uis
and connect to 3 OpenIAM (backends) machines. When using the JMeter tool pointing to the F5 that balances the 4 rProxys. When carrying about 5000 requests/second, several database errors might occur and cause connections to fail giving the following error.
javax.xml.ws.soap.SOAPFaultException: Could not open JPA EntityManager for transaction; nested exception is org.hibernate.exception.JDBCConnectionException: Unable to acquire JDBC Connectionat org.apache.cxf.jaxws.JaxWsClientProxy.mapException(JaxWsClientProxy.java:195) ~[cxf-rt-frontend-jaxws-3.3.6.jar:3.3.6]at org.apache.cxf.jaxws.JaxWsClientProxy.invoke(JaxWsClientProxy. java:145) ~[cxf-rt-frontend-jaxws-3.3.6.jar:3.3.6]at com.sun.proxy.$Proxy244.getLoginByManagedSys(Unknown Source) ~[?:?]at org.openiam.ui.rest.api.mvc.AuthenticationRestController.loginPost(AuthenticationRestController. java:332) ~[classes/:?]at org.openiam.ui.rest.api.mvc.AuthenticationRestController$$$FastClassBySpringCGLIB$$1e6d3f3d.invoke(<generated>) ~[classes/:?]at org.springframework.cglib.proxy.MethodProxy.invoke(MethodProxy. java:218) ~[spring-core-5.3.18.jar:5.3.18]at org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.invokeJoinpoint(CglibAopProxy.java:783) ~[spring-aop-5.3.18.jar:5.3.18]at org.springframework.aop.framework. ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:163) ~[spring-aop-5.3.18.jar:5.3.18]at org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.proceed(CglibAopProxy.java:753) ~[spring-aop-5.3.18. jar:5.3.18]at org.springframework.aop.aspectj.MethodInvocationProceedingJoinPoint.proceed(MethodInvocationProceedingJoinPoint.java:89) ~[spring-aop-5.3.18.jar:5.3.18]at org.openiam.ui.audit.AuditPointcut.processAuditLog(AuditPointcut. java:86) ~[openiam-ui-intf-4.2.1.13.jar:?]at jdk.internal.reflect.GeneratedMethodAccessor990.invoke(Unknown Source) ~[?:?]at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:?]at java.lang.reflect.Method. invoke(Method.java:566) ~[?:?]at org.springframework.aop.aspectj.AbstractAspectJAdvice.invokeAdviceMethodWithGivenArgs(AbstractAspectJAdvice.java:634) ~[spring-aop-5.3.18.jar:5.3.18]
Solution:
The problem may occur since the default property value is org.openiam.jdbc.connection.pool.size.max=20
. To resolve it, increase the value to up to 40. In case the error persists, increase it to up to 60.