Confluence is displaying pages slowly or showing 503 errors with PostgreSQL

お困りですか?

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

コミュニティに質問

プラットフォームについて: 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 は除く

問題

Confluence pages are displaying very slowly or users are seeing 503 errors in the browser.

診断

環境

  • PostgreSQL is used with c3p0 pooling. c3p0 is used in Confluence 7.13 and earlier.

Diagnostic Steps

  • Check <confluence-home>/confluence.cfg.xml for the value <property name="hibernate.c3p0.max_size">. The default is usually 30.

  • When the system is running slow, or showing 503 errors, run the following SQL command where USER is the username defined in <confluence-home>/confluence.cfg.xml for the database connection in <property name="hibernate.connection.username">

    from Linux shell
    while true; do sudo -u postgres psql -c "SELECT count(*) FROM pg_stat_activity where usename = 'USER';"; sleep 5; done
    in psql
     SELECT count(*) FROM pg_stat_activity where usename = 'USER';
  • If the count is equal to or close to hibernate.c3p0.max_size, this may indicate there are insufficient database connections.

  • Check the value of max_connections in postgresql.conf and ensure that it is greater than the  hibernate.c3p0.max_size. See also the PostgeSQL documentation on tuning. The default is usually 100.

    postgresql.conf
     max_connections = 100

原因

The c3p0 database connection pool is running out of connections and causing timeouts when accessing the database.

ソリューション

  • Increase the value of hibernate.c3p0.max_size in <confluence-home>/confluence.cfg.xml and restart Confluence.

    tip/resting Created with Sketch.

    Monitor the connections during peak time using the above script. The value cannot go higher than max_connections in postgresql.conf.


最終更新日: 2022 年 1 月 14 日

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

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