Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Recommended Connection Settings For AWS Lambda? #425

Answered by porsager
bestickley asked this question in Q&A
Discussion options

Hi, love this package! Makes queries a breeze. I'm using this in AWS Lambda. Does anyone have any recommendations for optimal connecting settings that don't hold on to connections too long which aren't ideal for a "serverless" environment? Ideally, I'd like something like sql.end() like from [serverless-mysql] (https://github.com/jeremydaly/serverless-mysql) which does "connection management".

image

Thank you!

You must be logged in to vote

Thanks a lot 😊

You'll properly know best based on your functions requirements, but setting idle_timeout to 0 will effectively close the connection as soon as no queries are queued. If you do several queries with other work inbetween perhaps 30 seconds is a good value.

Replies: 2 comments

Comment options

Based on How To: Manage RDS Connections from AWS Serverless Lamda Functions reducing the max_timeout to 10 minutes is maybe a start?

You must be logged in to vote
0 replies
Comment options

Thanks a lot 😊

You'll properly know best based on your functions requirements, but setting idle_timeout to 0 will effectively close the connection as soon as no queries are queued. If you do several queries with other work inbetween perhaps 30 seconds is a good value.

You must be logged in to vote
0 replies
Answer selected by bestickley
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet

AltStyle によって変換されたページ (->オリジナル) /