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

お困りですか?

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

コミュニティに質問


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

Support for Server* products ended on February 15th 2024. If you are running a Server product, you can visit the Atlassian Server end of support announcement to review your migration options.

*Fisheye および Crucible は除く

要約

Bamboo records an error in $BAMBOO_HOME/logs/atlassian-bamboo.log  when trying to connect to a Postgres database:

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

環境

  • PostgreSQL 

原因

Bamboo is requesting a higher number of connections from the database than it is able to provide. 

ソリューション

To correctly configure your Bamboo connection pool when talking to PostgreSQL (or any other database) the number of database connections requested by Bamboo must be less than the maximum number of connections (max_connections) configured on the database side (including overhead for superuser_reserved_connections)

Bamboo   

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

Bamboo < 7.2

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

Bamboo >= 7.2

<property name="hibernate.hikari.maximumPoolSize">100</property>

By default this will be set to 100.  This is generally a sensible default with little reason to change it unless its a very large Bamboo instance with lots of HTTP requests that are slow to serve.

In general this should be higher than the number of Tomcat HTTP threads (maxThreads) configured in $BAMBOO_INSTALL/conf/server.xml 


PostgresSQL:

Run the SQL command to check the amount of connections or PostgreSQL server is configured for.

show max_connections;

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

  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 configured for. 

 This value should be HIGHER than the value set in bamboo.cfg.xml above. If you have an unreasonably large amount of connections configured on the Bamboo side (e.g. >100) you may also consider decreasing it on the Bamboo side instead.

最終更新日 2023 年 5 月 24 日

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

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