Skip to content

pool.connect() suddenly takes 20 seconds to execute!? #2206

@Garfield2013

Description

@Garfield2013
console.time('timer1');
const client = await pool.connect();
console.timeEnd('timer1');

Normally the code above runs fast - but suddenly it takes 20 seconds!? How is this even possible? I can see other people report the same at StackOverflow- but what is the reason and most of all the solution to this issue?

According to this 3 years old post: https://stackoverflow.com/questions/43346895/node-js-pg-pool-slow-on-second-execute

these guys moved to the other NPM module: https://www.npmjs.com/package/pg-promise
But how would it fix anything - when it is based on node-postgres as well?

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions