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.

Hi. It seems that min parameter of Pool configuration is not used.

Code

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:open
  • Created 4 years ago
  • Reactions:2
  • Comments:5 (2 by maintainers)

github_iconTop GitHub Comments

2reactions
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
krabradostycommented, Apr 6, 2019

Strange, I think it can be useful: e.g. I want to know that there is a problem with a connection to DB before my app come in a state when it needs to perform a query. Right now when I detect that pool.totalCount is zero, I send SELECT now() to DB to maintain the connection.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Why do we need to set Min pool size in ConnectionString
If MinPoolSize is either not specified in the connection string or is specified as zero, the connections in the pool will be closed...
Read more >
5.3. Minimum pool size JBoss Enterprise Application ...
The min-pool-size data source parameter defines the minimum size of the connection pool. The default minimum is zero connections, so if a minimum...
Read more >
15 Small Backyard Pool Ideas (With Photos of Tiny Pools)
While the sizes and dimensions of pools vary, anything that's about 10 feet by 10 feet or smaller is typically considered a small...
Read more >
Performance issue when Min Pool Size set to 0 or 1
The biggest problem with a min connection > 0 is the potential for stale sessions. This can cause a JDBC service failure if...
Read more >
About Controlling the Pool Size in UCP - Oracle Help Center
The minimum pool size property specifies the minimum amount of available connections and borrowed connections that a pool maintains. A connection pool always ......
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