Heroku Postgres:连接过多。如何终止这些连接? [英] Heroku Postgres: Too many connections. How do I kill these connections?

查看:94
本文介绍了Heroku Postgres:连接过多。如何终止这些连接?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个在Heroku上运行的应用程序。这个程序安装了Postgres 9.2.4(Dev)插件。要访问我的在线数据库,我使用Navicat Postgres。有时Navicat不会完全关闭与Postgres数据库建立的连接。结果是一段时间后,有20多个与Postgres数据库的开放连接。我的Postgres安装只允许20个同时连接。因此,使用20多个开放的连接后,我的Postgress数据库现在无法访问(连接太多)。

I have an app running on Heroku. This app has an Postgres 9.2.4 (Dev) addon installed. To access my online database I use Navicat Postgres. Sometimes Navicat doesn't cleanly close connections it sets up with the Postgres database. The result is that after a while there are 20+ open connections to the Postgres database. My Postgres installs only allows 20 simultanious connections. So with the 20+ open connections my Postgress database is now unreachable (too many connections).

我知道这是Navicat的问题,我正在尝试解决这个问题为此。但是,如果发生这种情况(连接过多),我该如何解决(例如关闭所有连接)。

I know this is a problem of Navicat and I'm trying to solve this on that end. But if it happens (that there are too many connections), how can I solve this (e.g. close all connections).

我已经尝试了以下所有方法,

I've tried all of the following things, without result.


  • 已关闭Navicat&重新启动我的计算机(OS X 10.9)

  • 重新启动我的Heroku应用程序( heroku restart

  • 试图重新启动在线数据库,但是我发现没有选择这样做

  • 手动关闭从OS X到Postgres服务器IP的所有连接

  • 重新启动路由器

  • Closed Navicat & restarted my computer (OS X 10.9)
  • Restarted my Heroku application (heroku restart)
  • Tried to restart the online database, but I found out there is no option to do this
  • Manually closed all connections from OS X to the IP of the Postgres server
  • Restarted our router

我认为在Postgres端显然存在一些死连接。但是,如何关闭它们呢?

I think it's obvious there are some 'dead' connections at the Postgres side. But how do I close them?

推荐答案

也许可以看看 heroku pg:kill 能为您做什么? https://devcenter.heroku.com/articles/heroku-postgresql# pg-ps-pg-kill-pg-killall

Maybe have a look at what heroku pg:kill can do for you? https://devcenter.heroku.com/articles/heroku-postgresql#pg-ps-pg-kill-pg-killall

这篇关于Heroku Postgres:连接过多。如何终止这些连接?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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