3

私は ( playframework 2.0 - データベースの進化で max_user_connections を超えましたか? ) とまったく同じ問題を抱えていますが、今回はローカルの postgres インストールでのみ発生します。ハブ @ http://git.io/CdEntAに投げたサンプルアプリケーションがあります。

を使用して、ローカルで実行しようとします

sbt stage
target/start -DapplyEvolutions.default=true -Ddb.default.driver=org.postgresql.Driver -  Ddb.default.url="jdbc:postgresql://localhost:5432/test?user=myuser"

http://localhost:9000を起動すると、コンソールに表示されるのは...

[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: 10. Exception: null [info] play - Application started (Prod) [info] play - Listening for HTTP on port 9000... [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] c.j.b.PoolWatchThread - Error in trying to obtain a connection. Retrying in 1000ms org.postgresql.util.PSQLException: FATAL: sorry, too many clients already at org.postgresql.core.v3.ConnectionFactoryImpl.doAuthentication(ConnectionFactoryImpl.java:293) ~[postgresql-9.1-901-1.jdbc4.jar:na]

データベースをのぞいてみると、実際にはすべての接続がプロセスによって使い果たされていることがわかります。

どんな助けでも大歓迎です。

ありがとう。

4

2 に答える 2

2

Play アプリが使用する接続数を減らしてみてください。

以下は、5 つの接続のみを使用する構成です。

db.default.partitionCount=1
db.default.maxConnectionsPerPartition=5
db.default.minConnectionsPerPartition=5

基本的に接続数はpartitionCount x ConnectionsPerPartition

于 2012-04-25T07:07:23.640 に答える
2

db.default.user問題は、構成パラメーターをオーバーライドしていないため、sa値を使用していることだと思います。conf/application.confファイルの次の行をコメントアウトするだけです。

db.default.user=sa

それを実行して再実行すると、うまくいきsbt stageました。

于 2012-05-04T21:50:41.153 に答える