【问题标题】:Getting "FATAL: sorry, too many clients already" when the max_connections number is not reached未达到 max_connections 数时出现“致命:抱歉,已经有太多客户端”
【发布时间】:2020-01-09 12:11:22
【问题描述】:

当我尝试登录 PostgreSQL 数据库时,我收到错误“致命:抱歉,客户端已经太多”。我用sqlselect sum(numbackends) from pg_stat_database where datname = '$dbname';检查了另一个已经打开的会话的连接数,只有13个。但是max_connections设置为100。没有达到max_connections怎么会发生错误?

PostgreSQL 服务器是在 Docker 容器中运行的只读副本实例。我已经通过运行show max_connections; 验证了 max_connections 值。另外,这个错误对我来说似乎是随机的,因为有时我试图打开尽可能多的连接来测试限制,它可以打开 100 个连接,然后抛出错误。

【问题讨论】:

    标签: postgresql


    【解决方案1】:

    原来原因是 IO 被完全占用,几乎没有响应。然后它抛出错误“致命:抱歉,客户端已经太多了”,尽管没有达到最大连接数。

    【讨论】:

      猜你喜欢
      • 2011-02-14
      • 2012-12-12
      • 2019-06-18
      • 2020-07-05
      • 1970-01-01
      • 2019-05-21
      • 2018-06-20
      • 2022-10-16
      相关资源
      最近更新 更多