GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Support Min connection pool parameter #3009 by htrajan · Pull Request #3438 · brianc/node-postgres

Conversation

@htrajan

@htrajan htrajan commented Apr 23, 2025

Copy link
Copy Markdown
Contributor

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

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Harish T added 2 commits April 23, 2025 15:52
Harish T
Support Min connection pool parameter #3009
a8787af
Harish T
Remove extraneous change
29ef40c
chasdevs
chasdevs approved these changes Apr 24, 2025
View reviewed changes

@chasdevs chasdevs left a comment

Copy link
Copy Markdown

There was a problem hiding this 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 😅

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Harish T
streamline code
691d576
@brianc

brianc commented Apr 24, 2025

Copy link
Copy Markdown
Owner

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.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@htrajan

htrajan commented Apr 24, 2025

Copy link
Copy Markdown
Contributor Author

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?

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@charmander

charmander commented Apr 24, 2025

Copy link
Copy Markdown
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.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@brianc

brianc commented Apr 25, 2025

Copy link
Copy Markdown
Owner

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.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@brianc
brianc merged commit ff40638 into brianc:master Apr 25, 2025
@brianc brianc mentioned this pull request Apr 25, 2025
Update pool docs #3442
Merged
@brianc

brianc commented Apr 25, 2025

Copy link
Copy Markdown
Owner

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

htrajan, nikelborm, and ceneau reacted with rocket emoji
All reactions
  • 🚀 3 reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@htrajan
htrajan deleted the support_min_pool_size branch April 25, 2025 20:30
This was referenced Apr 25, 2025
[pg] Remove non-existent min option DefinitelyTyped/DefinitelyTyped#72455
Merged
Reintroduce [pg] min option DefinitelyTyped/DefinitelyTyped#72603
Merged
@htrajan

htrajan commented May 5, 2025

Copy link
Copy Markdown
Contributor Author

Hi @brianc, I'm not seeing the update in the latest 8.15.6 release. Do you have an ETA on this?

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@zyf0330

zyf0330 commented Jun 4, 2025

Copy link
Copy Markdown

When create connections with number more than min simultaneously, they all will be removed after idleTimeoutMillis.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@brianc

brianc commented Jun 12, 2025

Copy link
Copy Markdown
Owner

@htrajan @zyf0330 I'm seeing it right here am I missing something?

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@htrajan

htrajan commented Jun 12, 2025

Copy link
Copy Markdown
Contributor Author

@brianc nope, it's all good now. @zyf0330 might have spotted an edge case where my implementation doesn't work. Unfortunately, I'm pretty tied up now and won't have time to look into it in the near future. I was able to deploy the change to my company's application and get the desired outcome of no more pg-pool.connect spikes.

zyf0330 reacted with thumbs up emoji
All reactions
  • 👍 1 reaction

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@barryhagan barryhagan mentioned this pull request Jul 10, 2025
pg-pool min parameter is not obeyed with bursty traffic #3508
Closed
@EQuincerot EQuincerot mentioned this pull request Sep 21, 2026
Pool min size #1869
Open
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

1 more reviewer
@chasdevs chasdevs chasdevs approved these changes
Reviewers whose approvals may not affect merge requirements

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

5 participants

@htrajan @brianc @charmander @zyf0330 @chasdevs
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.