Confluence is displaying pages slowly or showing 503 errors with PostgreSQL
Platform notice: Server and Data Center only. This article only applies to Atlassian products on the server and data center platforms.
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.
Check <confluence-home>/confluence.cfg.xmlfor 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
USERis the username defined in
<confluence-home>/confluence.cfg.xmlfor 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; donein psql
SELECT count(*) FROM pg_stat_activity where usename = 'USER';
countis equal to or close to
hibernate.c3p0.max_size,this may indicate there are insufficient database connections.
Check the value of
postgresql.confand 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.xmland restart Confluence.
Monitor the connections during peak time using the above script. The value cannot go higher than