At first, I thought it had to do with the ORM I was using: mikro-orm/mikro-orm#7782, but it turns out to be an upstream issue.
Reproduction:
import { Pool } from 'pg'
const pool = new Pool()
Deno.serve(async () => {
await pool.query('select 1');
console.timeEnd('q1');
console.time('q2');
await pool.query('select 1');
console.timeEnd('q2');
return new Response('ok');
});
deno run -A --env-file index.js
The first time the website loads, it returns within miliseconds "ok". The second request, (and third etc.) are EXTREMELY SLOW (like 10-20 seconds or even more).
Details:
node-postgres version: 8.21.0
Deno version: 2.8.0
OS: Linux
Database: Docker (postgres:alpine, latest)
At first, I thought it had to do with the ORM I was using: mikro-orm/mikro-orm#7782, but it turns out to be an upstream issue.
Reproduction:
The first time the website loads, it returns within miliseconds "ok". The second request, (and third etc.) are EXTREMELY SLOW (like 10-20 seconds or even more).
Details:
node-postgres version:
8.21.0Deno version:
2.8.0OS: Linux
Database: Docker (
postgres:alpine, latest)