question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

min connections in pool does not work/exist, documentation issue

See original GitHub issue

I am reposting issue #1869. The docs listed here https://www.npmjs.com/package/pg-pool indicate you can specify a minimum amount of connections to keep open. But this functionally does not exist anywhere in the code except in the type file as a config option.

Are there plans to implement this feature otherwise please remove it from the documentation as it is misleading. Thank you.

Original post:

let pool = new Pool({
        database: connectionConfig.database,
        port: connectionConfig.port,
        nolimit: connectionConfig.nolimit,
        user: connectionConfig.user,
        password: connectionConfig.password,
        host: connectionConfig.host,
        min: 1
    });

Expected: At least one connection is always established

Actual: I receive a removed event with pool.totalCount equals to zero. After that my process is terminated.

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:6 (2 by maintainers)

github_iconTop GitHub Comments

3reactions
champikasamcommented, Mar 2, 2022

I also have a requirement to maintain a given, minimum number of connections to the database. Is there a known workaround to achieve this? I noticed that PgBouncer supports this but i prefer to use node-postgres if a viable workaround is available.

1reaction
sehropecommented, Nov 21, 2019

The min property has been removed from the README for pg-pool a few months ago (see https://github.com/brianc/node-pg-pool/commit/70d5c0995852fba68391a5d4a19e234043d86198) but a new version has not yet been published to NPM.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Connection Pooling Problems - Oracle Communities
Hi everyone, I am running into a problem with opening connections with ... I can change min pool size, max pool size, etc...
Read more >
Npgsql Minimum Pool Size seems to be not take into account
When a pool is created, multiple connection objects are created and added to the pool so that the minimum pool size requirement is...
Read more >
Connection pool settings - IBM
Unused physical connections are only discarded if the current number of connections exceeds the Minimum Connections setting. For example, if ...
Read more >
SQL Server Connection Pooling - ADO.NET - Microsoft Learn
If Min Pool Size is either not specified in the connection string or is ... and Audit Logout Event Class in the SQL...
Read more >
What is connection pooling, and why should you care
Why pool database connections? For simple operations at small scale, the steps involved in opening and closing a connection are not expensive ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found