-
Notifications
You must be signed in to change notification settings - Fork 42
Open
Description
I noticed while watching my DB and also watching debug events:
- I set floor to 3 and ceiling to 100 to account for very bursty activity.
- 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.
- 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.
Metadata
Metadata
Assignees
Labels
No labels