min connections in pool does not work/exist, documentation issue
See original GitHub issueI 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:
- Created 4 years ago
- Comments:6 (2 by maintainers)
Top 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 >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
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.
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.