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

お困りですか?

アトラシアン コミュニティをご利用ください。

コミュニティに質問


プラットフォームについて: Server と Data Center のみ - この記事は、サーバーおよびデータセンター プラットフォームのアトラシアン製品にのみ適用されます。

問題

Bamboo records an error when trying to connect to a Postgres database:

Acquisition Attempt Failed!!! Clearing pending acquires. While trying to 
acquire a needed new resource, we failed to succeed more than the maximum 
number of allowed acquisition attempts (30). Last acquisition attempt exception: 
org.postgresql.util.PSQLException: FATAL: sorry, too many clients already

診断

環境

  • Any Postgress database 
  • Any Bamboo newer than 5.0

原因

Bamboo is requesting a higher number of connections from the database than it is able to provide. Postgress will also need to have a number of Administrative threads free.

ソリューション

To correctly configure your Bamboo connection pool when talking to Postgres (or any other database) the number of connections requested by Bamboo MUST be less than the number of connections offered by the database. 

Bamboo の場合   

Locate your $BAMBOO_HOME/bamboo.cfg.xml file and look for the line 

<property name="hibernate.c3p0.max_size>100</property>

By default this will be set to 100.  This is a good default value to have. Don't change it unless you have talked to Atlassian Support first.

In Postgres:

Run the SQL command 

show max_connections.

If it's less than what you have Bamboo requesting above you will need to increase it.

To do so:

  1. Locate your postgresql.conf file  (You can run "SHOW config_file" in Postgres to locate it).
  2. Increase the max_connections value to more than the number that Bamboo is requesting. 

 This value should be HIGHER than the value set in bamboo.cfg.xml above. 

最終更新日: 2019 年 12 月 30 日

この内容はお役に立ちましたか?

はい
いいえ
この記事についてのフィードバックを送信する
Powered by Confluence and Scroll Viewport.