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

Pool always grows to ceiling and doesn't use idle connections #339

Open
bruceferguson2 opened this issue Jul 5, 2024 · 2 comments
Open

Comments

@bruceferguson2
Copy link

I noticed while watching my DB and also watching debug events:

  1. I set floor to 3 and ceiling to 100 to account for very bursty activity.
  2. I send a query to the pool (pool.promises.query) and it immediately ramps up to 100 connections INSTEAD of just using the three that are idle due to the floor setting.
  3. It appears that the grow() function ALWAYS ramps up to ceiling when any query comes in.

It seems like the grow function should have something like:

if (idle.length > 0) {
return;
}

let needed = "some-logic-for-computing-needed connections"

Then use "needed" in the for loop to add new connections to the pool.

Perhaps the logic could be parameterized with something like:
percentageToAdd
minToAdd
maxtoAdd

Just thinking off the top of my head.

@Ashwinkumar-R
Copy link

Hello
I am facing this issue too. Do we have any update on this issue ? This seems to be critical.

@TimelordUK
Copy link
Owner

it is very unlikely this will be changed, the library is now in maintenance - I will try and build latest version binaries to keep up to date with new node releases, but i do not have anything like the time anymore to go beyond that.

if anyone wishes to take it on, please fork and continue.

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

3 participants