Jira でのパフォーマンス低下と "複数の接続の危険な使用" エラー
プラットフォームについて: Data Center - この記事は、Data Center プラットフォームのアトラシアン製品に適用されます。
このナレッジベース記事は製品の Data Center バージョン用に作成されています。Data Center 固有ではない機能の Data Center ナレッジベースは、製品のサーバー バージョンでも動作する可能性はありますが、テストは行われていません。サーバー*製品のサポートは 2024 年 2 月 15 日に終了しました。サーバー製品を利用している場合は、アトラシアンのサーバー製品のサポート終了のお知らせページにて移行オプションをご確認ください。
*Fisheye および Crucible は除く
要約
Jira applications become slow during times of heavy usage.
The following lines may appear in atlassian-jira.log
:
2016-03-11 08:40:40,409 Caesium-1-2 WARN anonymous [c.a.jira.ofbiz.ConnectionPoolHealthSqlInterceptor] Dangerous use of multiple connections: taken => count=3; marks=[2-3]; pool=2/20
2016-03-11 08:40:40,409 Caesium-1-2 WARN anonymous [c.a.jira.ofbiz.ConnectionPoolHealthSqlInterceptor] Dangerous use of multiple connections: replaced => count=2; marks=[1-3]; pool=1/20
2016-03-11 08:40:40,409 Caesium-1-2 WARN anonymous [c.a.jira.ofbiz.ConnectionPoolHealthSqlInterceptor] Dangerous use of multiple connections: replaced => count=1; marks=[0-3]; pool=0/20
2016-03-11 08:40:40,409 Caesium-1-2 WARN anonymous [c.a.jira.ofbiz.ConnectionPoolHealthSqlInterceptor] Dangerous use of multiple connections: replaced => count=0; marks=[-1-3]; pool=-1/20
診断
Jira 5.0.3 以降をご利用の場合、Jira アプリケーション内でコネクション プールを監視できます。メニューの歯車アイコン > [システム] > [データベース監視] に移動すると、直近 6 時間のコネクション プールの統計情報のグラフが表示されます。
If you see the number of Active Connections is consistently at or near the maximum number of connections in the pool (the graph is scaled to the maximum available connections, 20 in the above example), Jira is suffering from pool exhaustion.
If you are using a version of Jira prior to 5.0.3, the best way to see this type of behavior is by Generating a Thread Dump. Below is a sample snippet of a thread dump showing this problem:
"Thread-4" prio=6 tid=0x16d85988 nid=0xe20 in Object.wait() [0x17d9f000..0x17d9fce8]
at java.lang.Object.wait(Native Method)
- waiting on <0x04139d18> (a org.apache.tomcat.dbcp.pool.impl.GenericObjectPool)
at java.lang.Object.wait(Object.java:474)
at org.apache.tomcat.dbcp.pool.impl.GenericObjectPool.borrowObject(GenericObjectPool.java:748)
- locked <0x04139d18> (a org.apache.tomcat.dbcp.pool.impl.GenericObjectPool)
at org.apache.tomcat.dbcp.dbcp.PoolingDataSource.getConnection(PoolingDataSource.java:95)
at org.apache.tomcat.dbcp.dbcp.BasicDataSource.getConnection(BasicDataSource.java:540)
at org.ofbiz.core.entity.transaction.JNDIFactory.getJndiConnection(JNDIFactory.java:168)
at org.ofbiz.core.entity.transaction.JNDIFactory.getConnection(JNDIFactory.java:140)
at org.ofbiz.core.entity.TransactionFactory.getConnection(TransactionFactory.java:99)
at org.ofbiz.core.entity.ConnectionFactory.getConnection(ConnectionFactory.java:53)
at com.atlassian.jira.upgrade.ConnectionKeeper.openConnections(ConnectionKeeper.java:106)
at com.atlassian.jira.upgrade.ConnectionKeeper.run(ConnectionKeeper.java:87)
この問題を示す行は次のものです。
- locked <0x04139d18> (a org.apache.tomcat.dbcp.pool.impl.GenericObjectPool)
at org.apache.tomcat.dbcp.dbcp.PoolingDataSource.getConnection(PoolingDataSource.java:95)
原因
The default value set for the connection pool in Jira applications is 20, and it is sufficient for the normal usage.
The number of user plugins installed influences the number of database connections in use and it requires that the pool size to be increased.
ソリューション
Jira 5.1 以降
Increase the maximum number of connections in the connection pool using Jira configuration tool or by editing the dbconfig.xml
. The parameter to be increased is 'Maximum Size
'. We recommend using the recommended dbconfig.xml
as defined in the appropriate database documentation as specified in Connecting Jira to a Database.
Jira 5.1 - 4.4
Modify the dbconfig.xml
and increase the pool-max-size,
parameters. Refer Connecting Jira to a Database for details about editing pool-min-size
and pool-max-idle
dbconfig.xml
.
Jira 4.4 以前
Modify the conf/server.xml
and increase the maxActive
, minIdle
and maxIdle
parameters. Refer Connecting Jira to a Database for details about editing conf/server.xml
. A sample configuration is given below:
<Resource name="jdbc/JiraDS" auth="Container" type="javax.sql.DataSource"
username="sa"
password=""
driverClassName="org.hsqldb.jdbcDriver"
url="jdbc:hsqldb:${catalina.home}/database/jiradb"
minEvictableIdleTimeMillis="4000"
timeBetweenEvictionRunsMillis="5000"
maxActive="20"
minIdle="4"
maxIdle="8"
/>
これらの値の意味については Apache DBCP のドキュメントをご確認ください。