gpt4 book ai didi

node.js - 错误 : sorry, 已经有太多客户端

转载 作者:行者123 更新时间:2023-11-29 14:31:35 24 4
gpt4 key购买 nike

我在我的 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
});

由于上述错误,我无法查询数据库。我无法解决这个问题。你能提出解决方案吗

最佳答案

下面的查询会帮助你。

select max_conn,used,res_for_super,max_conn-used-res_for_super res_for_normal 
from
(select count(*) used from pg_stat_activity) t1,
(select setting::int res_for_super from pg_settings where name=$$superuser_reserved_connections$$) t2,
(select setting::int max_conn from pg_settings where name=$$max_connections$$) t3

关于node.js - 错误 : sorry, 已经有太多客户端,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/50947066/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com