AWS Lambda RDS连接池 [英] AWS Lambda RDS Connection Pooling
问题描述
我们正在尝试将AWS X ray JDBC拦截器添加到我们的lambda函数中,并且为了添加JDBC拦截器,我们添加了具有最大活动连接数和最大空闲连接数为1的Tomcat JDBC数据源. 连接已关闭错误". 我们观察到的另一种模式是Lambda花了将近10分钟的时间来刷新来自Aurora DB的连接. 是否有人成功使用Lambda(Java 8)和RDS(Aurora)实现了连接池.
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).
推荐答案
最近,我通过最新的MariaDB Connector-J和aurora
故障转移取得了一些成功.到目前为止,我对jdbc
网址(如jdbc:mariadb:aurora://host:port/db?...
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?...
请参见我仍在致力于实现无错误的连接池,但是偶尔会遇到HikariCP关于TransientConnectionError
或DE
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
这篇关于AWS Lambda RDS连接池的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!