gpt4 book ai didi

PostgreSQL 演变 : "PSQLException: FATAL: sorry, too many clients already"

转载 作者:行者123 更新时间:2023-11-29 11:19:16 30 4
gpt4 key购买 nike

我正在尝试设置开发 PostgreSQL 服务器。它正在运行,我能够从命令行创建角色、表等。但是,当我尝试使用 Play 应用进化时,出现以下错误:

org.postgresql.util.PSQLException: FATAL: sorry, too many clients already

我能够连接,如果我故意输入语法错误,它会返回语法错误,所以我知道 Play 能够连接到数据库。然而,在成功应用进化后,我得到如上所示的错误。

我不太精通 PostgreSQl 管理,所以我不确定问题出在 Play 还是我的 PostgreSQL 安装上。我刚刚在运行 Mountain Lion 的 Mac 上使用 Heroku 的 Postgres.app 安装了它。

这是写入控制台的内容:

! @6cnb0blpp - Internal server error, for request [GET /] ->

play.api.db.evolutions.InvalidDatabaseRevision: Database 'default' needs evolution! [An SQL script need to be run on your database.]
at play.api.db.evolutions.EvolutionsPlugin$$anonfun$onStart$1$$anonfun$apply$1.apply$mcV$sp(Evolutions.scala:427) ~[play_2.9.1.jar:2.0.4]
at play.api.db.evolutions.EvolutionsPlugin.withLock(Evolutions.scala:448) ~[play_2.9.1.jar:2.0.4]
at play.api.db.evolutions.EvolutionsPlugin$$anonfun$onStart$1.apply(Evolutions.scala:414) ~[play_2.9.1.jar:2.0.4]
at play.api.db.evolutions.EvolutionsPlugin$$anonfun$onStart$1.apply(Evolutions.scala:412) ~[play_2.9.1.jar:2.0.4]
at scala.collection.LinearSeqOptimized$class.foreach(LinearSeqOptimized.scala:59) ~[scala-library.jar:0.11.3]
at scala.collection.immutable.List.foreach(List.scala:45) ~[scala-library.jar:0.11.3]
[error] c.j.b.h.AbstractConnectionHook - Failed to acquire connection Sleeping for 1000ms and trying again. Attempts left: 10. Exception: null
[error] c.j.b.h.AbstractConnectionHook - Failed to acquire connection Sleeping for 1000ms and trying again. Attempts left: 9. Exception: null
[error] c.j.b.h.AbstractConnectionHook - Failed to acquire connection Sleeping for 1000ms and trying again. Attempts left: 8. Exception: null
[error] c.j.b.h.AbstractConnectionHook - Failed to acquire connection Sleeping for 1000ms and trying again. Attempts left: 7. Exception: null
[error] c.j.b.h.AbstractConnectionHook - Failed to acquire connection Sleeping for 1000ms and trying again. Attempts left: 6. Exception: null
[error] c.j.b.h.AbstractConnectionHook - Failed to acquire connection Sleeping for 1000ms and trying again. Attempts left: 5. Exception: null
[error] c.j.b.h.AbstractConnectionHook - Failed to acquire connection Sleeping for 1000ms and trying again. Attempts left: 4. Exception: null
[error] c.j.b.h.AbstractConnectionHook - Failed to acquire connection Sleeping for 1000ms and trying again. Attempts left: 3. Exception: null
[error] c.j.b.h.AbstractConnectionHook - Failed to acquire connection Sleeping for 1000ms and trying again. Attempts left: 2. Exception: null
[error] c.j.b.h.AbstractConnectionHook - Failed to acquire connection Sleeping for 1000ms and trying again. Attempts left: 1. Exception: null
[error] application -

谢谢!

最佳答案

允许的连接数在 postgresql.conf 中使用 GUC(“Grand Unified Configuration”)max_connections 设置.默认值为 100。

但在修改设置之前,您必须问自己:在您的集群达到限制之前,所有其他 100 个连接是从哪里来的?这通常表明您的安装或程序中存在错误!

您可能还对 connection pooling 感兴趣还有这个article about The Number of Connections在 Postgres Wiki 中。

关于PostgreSQL 演变 : "PSQLException: FATAL: sorry, too many clients already",我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/14049185/

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