Skip to content
This repository was archived by the owner on Dec 30, 2019. It is now read-only.
This repository was archived by the owner on Dec 30, 2019. It is now read-only.

Problems with config.min  #104

@thosaa

Description

@thosaa

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:

config = {
    // connection params leaved out
    keepAlive: true, 
    ssl: true,
    max: 10, 
    min: 2, 
    idleTimeoutMillis: 20000
};

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions