【发布时间】:2024-01-12 13:44:01
【问题描述】:
我在我的 NodeJS 后端服务中使用 PostgreSQL。突然之间,当我启动服务时,我面临以下错误
connection error error: sorry, too many clients already.
PostgresSQL 连接配置
const pg = require(“pg”);
const client = new pg.Client({
host: “txslmxxxda6z”,
user: “mom”,
password: “mom”,
db: “mom”,
port: 5025
});
由于上述错误,我无法查询数据库。我无法解决这个问题。能否请您提出解决方案
【问题讨论】:
-
关闭一些数据库连接,使您低于
max_connections。 -
关闭长时间空闲的空闲连接..
-
你能建议我怎么做吗
标签: node.js postgresql pg