Heroku的“PSQL:FATAL:剩余的连接插槽预留给非复制超级连接” [英] Heroku “psql: FATAL: remaining connection slots are reserved for non-replication superuser connections”

查看:1984
本文介绍了Heroku的“PSQL:FATAL:剩余的连接插槽预留给非复制超级连接”的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在运行的Heroku Postgres的基础上面的错误消息(<一href="http://stackoverflow.com/questions/11847144/heroku-psql-fatal-remaining-connection-slots-are-reserved-for-non-replication">as每次这个问题),并一直试图诊断问题。

其中一个建议是使用连接池,但它似乎<一href="http://stackoverflow.com/questions/5826381/is-there-any-reason-to-use-a-database-connection-pool-with-activerecord">Rails有这个建于。另一个建议是,应用程序配置不当,并打开过多的连接。

我的应用程序对其进行管理的,通过活动记录所有的连接,我不得不从Navicat的一个直接连接到数据库(或至少我认为我有)。

我怎么会调试呢?

解决方案

原来这是一个Heroku的问题。从Heroku的支持:

  

我们已经检测到运行的基本数据库的服务器上的一个问题。   虽然我们找出这一点,解决这个问题,我们建议您   提供一个新的基础数据库,并在迁移与PGBackups作为   这里详细介绍:   <一href="https://devcenter.heroku.com/articles/upgrade-heroku-postgres-with-pgbackups">https://devcenter.heroku.com/articles/upgrade-heroku-postgres-with-pgbackups   。这应该把你的数据库在新服务器上。我为这个道歉   破坏 - 我们正在努力从解决这个问题,prevent它   发生在将来。

解决方案

您可能能够找到为什么你必须通过检查视图的和pg_stat_activity

  SELECT * FROM和pg_stat_activity
 

最有可能的,你有一些打开新的连接(S),而不将其关闭流浪循环。

I got the above error message running Heroku Postgres Basic (as per this question) and have been trying to diagnose the problem.

One of the suggestions is to use connection pooling but it seems Rails has this built in. Another suggestion is that the app is configured improperly and opens too many connections.

My app manages all it's connections through Active Record, and I had one direct connection to the database from Navicat (or at least I thought I had).

How would I debug this?

RESOLUTION

Turns out it was an Heroku issue. From Heroku support:

We've detected an issue on the server running your Basic database. While we pinpoint this and address it, we would recommend you provision a new Basic database and migrate over with PGBackups as detailed here: https://devcenter.heroku.com/articles/upgrade-heroku-postgres-with-pgbackups . That should put your database on a new server. I apologize for this disruption – we're working to fix this issue and prevent it from occurring in the future.

解决方案

You might be able to find why you have so many connections by inspecting view pg_stat_activity:

SELECT * FROM pg_stat_activity

Most likely, you have some stray loop that opens new connection(s) without closing it.

这篇关于Heroku的“PSQL:FATAL:剩余的连接插槽预留给非复制超级连接”的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆