postgresql-dart icon indicating copy to clipboard operation
postgresql-dart copied to clipboard

Connection time ~5-8x longer to Postgres14

Open zambetpentru opened this issue 4 years ago • 3 comments

Hi,

I noticed when testing an upgrade to PostgreSQL14 that there is about a 5-8x connection time increase versus 13.2. I testing separately by running fresh Docker Hub Postgres 13.2 and 14 images with the default settings.

Latest version of postgres package: 2.4.1+2

times in ms: image

Interestingly pgbench doesn't see much connection difference if any between 13 and 14.

var conn = PostgreSQLConnection('ServerName', 5432, 'dbname', username: 'user', password: 'password!'); Stopwatch swc = Stopwatch()..start(); await conn.open(); print('connection time:' + swc.elapsedMilliseconds.toString());

The actual query times don't see to have varied much.

I haven't had a chance to dig into the code itself to see if I can figure it out, do you have any ideas in mind what it could be?

zambetpentru avatar Oct 12 '21 06:10 zambetpentru

This PR did affect how connection happens: https://github.com/isoos/postgresql-dart/pull/6 I haven't done any investigation if it affects connecting times, it would be nice if you could dig into it... Note: please use forked repository to report new issues.

isoos avatar Oct 12 '21 06:10 isoos

Hi @isoos I would have but it seems like the Issues section is not visible to the public?

https://github.com/isoos/postgresql-dart

zambetpentru avatar Oct 12 '21 10:10 zambetpentru

@zambetpentru: thanks, I haven't noticed that. Enabled now :)

isoos avatar Oct 12 '21 11:10 isoos

I believe this is due to the different authentication type. Not an issue when using the connection pool :-)

zambetpentru avatar Aug 29 '23 18:08 zambetpentru