Jira is slow due to poor database connection performance
プラットフォームについて: 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 は除く
問題
Any Jira function is slow on every node of the cluster. Restarting the application nodes or the database does not help with the problem.
診断
- Thread dumps show that all the threads are waiting at the database operations:
java.net.SocketInputStream.socketRead0(java.base@11.0.20/Native Method)
java.net.SocketInputStream.socketRead(java.base@11.0.20/SocketInputStream.java:115)
java.net.SocketInputStream.read(java.base@11.0.20/SocketInputStream.java:168)
java.net.SocketInputStream.read(java.base@11.0.20/SocketInputStream.java:140)
org.postgresql.core.VisibleBufferedInputStream.readMore(VisibleBufferedInputStream.java:161)
org.postgresql.core.VisibleBufferedInputStream.ensureBytes(VisibleBufferedInputStream.java:128)
org.postgresql.core.VisibleBufferedInputStream.ensureBytes(VisibleBufferedInputStream.java:113)
org.postgresql.core.VisibleBufferedInputStream.read(VisibleBufferedInputStream.java:223)
java.io.InputStream.read(java.base@11.0.20/InputStream.java:205)
org.postgresql.core.PGStream.receiveInteger2(PGStream.java:482)
org.postgresql.core.PGStream.receiveTupleV3(PGStream.java:592)
org.postgresql.core.v3.QueryExecutorImpl.processResults(QueryExecutorImpl.java:2332)
org.postgresql.core.v3.QueryExecutorImpl.execute(QueryExecutorImpl.java:355)
org.postgresql.jdbc.PgStatement.executeInternal(PgStatement.java:490)
org.postgresql.jdbc.PgStatement.execute(PgStatement.java:408)
org.postgresql.jdbc.PgPreparedStatement.executeWithFlags(PgPreparedStatement.java:167)
org.postgresql.jdbc.PgPreparedStatement.executeQuery(PgPreparedStatement.java:119)
org.apache.commons.dbcp2.DelegatingPreparedStatement.executeQuery(DelegatingPreparedStatement.java:83)
org.apache.commons.dbcp2.DelegatingPreparedStatement.executeQuery(DelegatingPreparedStatement.java:83)
org.ofbiz.core.entity.jdbc.SQLProcessor.executeQuery(SQLProcessor.java:527)
org.ofbiz.core.entity.GenericDAO.createEntityListIterator(GenericDAO.java:881)
org.ofbiz.core.entity.GenericDAO.selectListIteratorByCondition(GenericDAO.java:861)
org.ofbiz.core.entity.GenericHelperDAO.findListIteratorByCondition(GenericHelperDAO.java:216)
org.ofbiz.core.entity.GenericDelegator.findListIteratorByCondition(GenericDelegator.java:1247)
com.atlassian.jira.ofbiz.DefaultOfBizDelegator.findListIteratorByCondition(DefaultOfBizDelegator.java:405)
com.atlassian.jira.ofbiz.WrappingOfBizDelegator.findListIteratorByCondition(WrappingOfBizDelegator.java:283)
com.atlassian.jira.entity.SelectQueryImpl$ExecutionContextImpl.forEach(SelectQueryImpl.java:227)
com.atlassian.jira.entity.SelectQueryImpl$ExecutionContextImpl.asList(SelectQueryImpl.java:164)
com.atlassian.jira.user.util.UserKeyStoreImpl.buildCache(UserKeyStoreImpl.java:226)
com.atlassian.jira.user.util.UserKeyStoreImpl.<init>(UserKeyStoreImpl.java:69)
....
....
- Restarting the DB and the nodes helps for a few minutes but the application starts performing badly right after that.
- The database queries are taking quite a long time to finish sending results back to Jira, queries are active in the database:
- Running any maintenance (e.g. in PostgreSQL, Vacuuming and Analyzing the Indexes and tables) command in the DB to increase the performance does not help
ソリューション
If you or your database admins can't find anything but if the problem is still there, consult your OS and network admins to check the database or Jira node network interfaces to see if there are any faulty ones.