Skip to content

Support Min connection pool parameter #3009 #3438

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

Merged
merged 3 commits into from
Apr 25, 2025

Conversation

htrajan
Copy link
Contributor

@htrajan htrajan commented Apr 23, 2025

My attempt to address #3009

Hopefully this is sensible with the tests I've included

I suspect that lack of this functionality is causing my company's app to frequently hit bottlenecks with allocating new db pool connections

Copy link

@chasdevs chasdevs left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM; I'm not a maintainer of this library, though 😅

@brianc
Copy link
Owner

brianc commented Apr 24, 2025

nice tests. this looks good to me, tbh! I prefer my pools to drain when my app is idle...feels better to me than leaving a bunch of sockets open doing nothing for > 5 minutes, but I can definitely see in some "needs to be fast, but gets spikey traffic" this could come in handy. That initial connection to the backend is no joke. I've seen it take upwards of a second on GCS in the past.

@htrajan
Copy link
Contributor Author

htrajan commented Apr 24, 2025

nice tests. this looks good to me, tbh! I prefer my pools to drain when my app is idle...feels better to me than leaving a bunch of sockets open doing nothing for > 5 minutes, but I can definitely see in some "needs to be fast, but gets spikey traffic" this could come in handy. That initial connection to the backend is no joke. I've seen it take upwards of a second on GCS in the past.

Great! What would be the next steps to get this into the next release?

@charmander
Copy link
Collaborator

Thoughts on implementing or documenting:

  • prefilling the pool to the minimum
  • maintaining the minimum on connection errors

?

Keepalives are also sort of related to this, but I think any documentation and work needed there stands on its own.

@brianc
Copy link
Owner

brianc commented Apr 25, 2025

Thoughts on implementing or documenting:

  • prefilling the pool to the minimum
  • maintaining the minimum on connection errors

?

I can document that this is not implemented at the moment, and merge this as a first step. Those other things yeah could come in the future.

@brianc brianc merged commit ff40638 into brianc:master Apr 25, 2025
6 checks passed
@brianc brianc mentioned this pull request Apr 25, 2025
@brianc
Copy link
Owner

brianc commented Apr 25, 2025

I will release a new minor version of pg-pool on Monday morning. i don't like doing afternoon/evening releases because I always like to be around and online throughout the day to respond to any unintentional breaking changes or bugs

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

Successfully merging this pull request may close these issues.

4 participants