System Information
- Strapi Version: 4.1.3
- Operating System: MacOS
- Database: PostgreSQL 13
- Node Version: 16
- NPM Version:
- Yarn Version:
I am often running in the following error. I’m hosting on www.render.com.
KnexTimeoutError: Knex: Timeout acquiring a connection. The pool is probably full. Are you missing a .transacting(trx) call? at Client_PG.acquireConnection (/opt/render/project/src/node_modules/knex/lib/client.js:295:26) at async Runner.ensureConnection (/opt/render/project/src/node_modules/knex/lib/execution/runner.js:259:28) at async Runner.run (/opt/render/project/src/node_modules/knex/lib/execution/runner.js:30:19) at async PostgresqlSchemaInspector.getForeignKeys (/opt/render/project/src/node_modules/@strapi/database/lib/dialects/postgresql/schema-inspector.js:205:22) at async /opt/render/project/src/node_modules/@strapi/database/lib/dialects/postgresql/schema-inspector.js:127:29 at async Promise.all (index 32) at async PostgresqlSchemaInspector.getSchema (/opt/render/project/src/node_modules/@strapi/database/lib/dialects/postgresql/schema-inspector.js:123:21) at async Object.syncSchema (/opt/render/project/src/node_modules/@strapi/database/lib/schema/index.js:51:24) at async Strapi.bootstrap (/opt/render/project/src/node_modules/@strapi/strapi/lib/Strapi.js:380:5) at async Strapi.load (/opt/render/project/src/node_modules/@strapi/strapi/lib/Strapi.js:408:5) at async Strapi.start (/opt/render/project/src/node_modules/@strapi/strapi/lib/Strapi.js:161:9)
My node Strapi service is running on 2 CPU and 4GB RAM.
My Postgres database is running on 2 CPU and 4GB RAM.
I’m using the following settings in /config/env/production/database.js
const { parse } = require("pg-connection-string");
module.exports = ({ env }) => {
const { host, port, database, user, password } = parse(env("DATABASE_URL"));
return {
connection: {
client: "postgres",
connection: {
host,
port,
database,
user,
password,
ssl: {
rejectUnauthorized: false,
},
},
debug: true,
pool: {
min: 0,
max: 10,
idleTimeoutMillis: 30000000,
createTimeoutMillis: 30000000,
acquireTimeoutMillis: 30000000,
propagateCreateError: false,
},
},
};
};
Has anyone found good settings to use on Render.com to avoid running in this error?