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

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

htrajan
Copy link

@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
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.

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