I had the same issue and this comment helped me a lot. I’m on strapi v3, on digitalocean apps platform and using DO’s managed databases running postgres v14.
I did include the pool config to my database.js file inside strapi config fodler and increased the db RAM from 1gb to 2gb. Could not connect to digital ocean’s Connection Pools though, strapi kept crashing saying that cross-database references was not configured and I couldn’t manage to make it work, so I just reverted back to connecting directly to my pg db.
Last thing I recommend ( according to knex.js docs ) that you set pool.min : 0
that means that tarn.js (what knex uses to manage pooling) will terminate all idle connections, preventing this error to happen again.
so thanks @michaelstokes93 and @RenderMaster