AWS Lambda RDS Connection Pooling

自古美人都是妖i 提交于 2019-12-10 15:16:02

问题


We are trying to add AWS X ray JDBC interceptor to our lambda functions and in order to add JDBC interceptor we have added Tomcat JDBC datasource with max active and max idle connection as 1. Connections are not getting reused and we are getting lot of "connection already closed error". Another pattern we observed is Lambda is taking almost 10 minutes to flush the connection from Aurora DB. Did any one successfully implemented connection pooling with Lambda.( Java 8) and RDS (Aurora).


回答1:


I've had some recent success with the latest MariaDB Connector-J and aurora failover. I've had no issues with any queries as of yet with my jdbc url like jdbc:mariadb:aurora://host:port/db?...

See https://mariadb.com/kb/en/the-mariadb-library/failover-and-high-availability-with-mariadb-connector-j/#specifics-for-amazon-aurora

I'm still working on error-free connection pooling, but I'm running into the occasional DEBUG from HikariCP about TransientConnectionError or the MariaDB Connector-J with NullPointerException



来源:https://stackoverflow.com/questions/44581622/aws-lambda-rds-connection-pooling

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!