Closed thosaa closed 5 years ago
The README is out of date and needs to be updated. There is no min
options anymore. Just max
and idleTimeoutMillis
.
Originally this module was built atop the generic-pool module that allowed for those options. It was subsequently rewritten to handle the pooling itself for more fine grained control over how errors are handled. See https://github.com/brianc/node-pg-pool/pull/67 for more details.
Okay. Thanks for info and link.
Hi I'm having trouble with the config.min setting, which is shown in the README file at https://github.com/brianc/node-pg-pool/blob/master/README.md as 'min: 4, // set min pool size to 4'.
I was expecting that when this config was used:
the pool would initiate two clients when the first client was requested and maintain any number of clients between min and max. The is the behaviour that I'm seeing in Java using the C3P0 pool manager; https://www.mchange.com/projects/c3p0/#basic_pool_configuration
Looking at the connect and remove events and outputting the totalCount, when only making one query using pool.query, there is only one connection made and it is released after the idleTimeoutMillis.
I did a quick look for "max" in the code and looked around for "min" the the nearby but with no results.
So I'm having doubt that this parameter is used at all? Could someone please enlighten me on this?
Thanks