Skip to content

Suitable values for poolSize, poolIdleTimeout and reapIntervalMillis #1222

Closed
@WarTech9

Description

@WarTech9

This is more of a question than an issue.

I'm using node-postgres and have had some issues with the connection pool getting exhausted (I think mainly due to connection leaks). I'm trying to find out the optimal values for pool size and timeouts. Let's say I expect to have 1000 concurrent users and most users will be making requests that result in db requests. My database server has limited resources with 1 CPU and 2GB or RAM.

What would be the ideal values for these settings? I'm currently using this:

pg.defaults.poolSize = 25;
pg.defaults.reapIntervalMillis = 1000;
pg.defaults.poolIdleTimeout = 1000;

Also I'm a question about the poolIdleTimeout. The comments in the code says:

max milliseconds a client can go unused before it is removed from the pool and destroyed

Does this mean the amount of time before the connection is closed and returned to the pool, or the connection is closed and removed from the pool, thus decreasing pool size?

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions