代码之家  ›  专栏  ›  技术社区  ›  YogeshR

Postgresql |剩余的连接插槽是为非复制超级用户连接保留的

  •  1
  • YogeshR  · 技术社区  · 7 年前

    我有个错误” 剩余的连接插槽是为非复制超级用户连接保留的 “在一个PostgreSQL实例上。

    但是,当我从超级用户运行下面的查询以检查可用连接时,我发现有足够的可用连接。但还是犯了同样的错误。

    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
    

    输出

    enter image description here

    我搜索了这个错误,每个人都建议增加如下链接的最大连接数。 Heroku "psql: FATAL: remaining connection slots are reserved for non-replication superuser connections"

    编辑

    我重新启动了服务器,一段时间后使用的连接数几乎达到210,但我能够从普通用户连接到服务器。

    0 回复  |  直到 7 年前