Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

pg connection max lifetime? #5123

Closed
domasx2 opened this issue Jun 17, 2020 · 5 comments
Closed

pg connection max lifetime? #5123

domasx2 opened this issue Jun 17, 2020 · 5 comments

Comments

@domasx2
Copy link

domasx2 commented Jun 17, 2020

Hi,

There a way to specify max lifetime of a pooled connection, so it's closed after X seconds and a new one is opened?

Thanks

@tirumaraiselvan
Copy link
Contributor

@domasx2
Copy link
Author

domasx2 commented Jun 17, 2020

Hi, thanks for reply. This is idle timeout, but I mean forcing recycle even if connection hasn't been idle for X seconds

@jberryman
Copy link
Collaborator

@domasx2 We've implemented this as essentially a bug fix, awaiting review. See #5087 and attached PRs

At the moment it works like this: when a thread takes a connection from the pool, if it is older than 60sec it will be destroyed. This can (probably should) be made configurable. Note the idle timeout still comes into play. Setting it to 60s would ensure connections are always closed approximately every 60 sec

@0x777
Copy link
Member

0x777 commented Jun 17, 2020

@domasx2 Any reason why you would want to do this? As @jberryman pointed out, we might add this as a workaround for a leak that we discovered in libpq but not as a feature.

@domasx2
Copy link
Author

domasx2 commented Jun 18, 2020

Hey,
My mistake. I misunderstood our pgpool config, don't need it after all. Sorry, and thanks for the replies!

@domasx2 domasx2 closed this as completed Jun 18, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants