Poor performance due to Confluence Usage Tracking plugin
Platform Notice: Data Center - This article applies to Atlassian products on the Data Center platform.
Note that this knowledge base article was created for the Data Center version of the product. Data Center knowledge base articles for non-Data Center-specific features may also work for Server versions of the product, however they have not been tested. 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.
*Except Fisheye and Crucible
Problem
Confluence performs poorly, in unpredictable patterns.
Diagnosis
A thread dump contains threads like:
"Thread-57" daemon prio=10 tid=0x08a5e000 nid=0x3338 runnable [0xb2485000..0xb2485e30]
java.lang.Thread.State: RUNNABLE
at java.lang.String.intern(Native Method)
at org.apache.lucene.index.FieldsReader$FieldForMerge.<init>(FieldsReader.java:487)
at org.apache.lucene.index.FieldsReader.addFieldForMerge(FieldsReader.java:219)
at org.apache.lucene.index.FieldsReader.doc(FieldsReader.java:124)
at org.apache.lucene.index.SegmentReader.document(SegmentReader.java:333)
- locked <0x478112e8> (a org.apache.lucene.index.SegmentReader)
at org.apache.lucene.index.SegmentMerger.mergeFields(SegmentMerger.java:207)
at org.apache.lucene.index.SegmentMerger.merge(SegmentMerger.java:97)
at org.apache.lucene.index.IndexWriter.mergeSegments(IndexWriter.java:1883)
at org.apache.lucene.index.IndexWriter.optimize(IndexWriter.java:1231)
- locked <0x47811400> (a org.apache.lucene.index.IndexWriter)
at com.atlassian.bonnie.LuceneConnection.optimize(LuceneConnection.java:306)
at com.atlassian.confluence.ext.usage.index.UsageIndexManager.index(UsageIndexManager.java:233)
at com.atlassian.confluence.ext.usage.event.UsageEventListener$1.run(UsageEventListener.java:78)
at EDU.oswego.cs.dl.util.concurrent.QueuedExecutor$RunLoop.run(QueuedExecutor.java:89)
at java.lang.Thread.run(Thread.java:619)
or
"TP-Processor29" daemon prio=10 tid=0x08f16c00 nid=0x33d9 in Object.wait() [0xb2daa000..0xb2dade30]
java.lang.Thread.State: WAITING (on object monitor)
at java.lang.Object.wait(Native Method)
at java.lang.Object.wait(Object.java:485)
at EDU.oswego.cs.dl.util.concurrent.BoundedLinkedQueue.put(BoundedLinkedQueue.java:303)
- locked <0x4d3c2910> (a EDU.oswego.cs.dl.util.concurrent.BoundedLinkedQueue)
- locked <0x4d42fc10> (a java.lang.Object)
at EDU.oswego.cs.dl.util.concurrent.QueuedExecutor.execute(QueuedExecutor.java:158)
at com.atlassian.confluence.ext.usage.event.UsageEventListener.addTask(UsageEventListener.java:70)
at com.atlassian.confluence.ext.usage.event.UsageEventListener.handleEvent(UsageEventListener.java:58)
Cause
The Usage Plugin does not scale for large indexes. Some indexing operations can cause hangs.
Resolution
Disable the Confluence Usage Tracking Plugin or Confluence Usage Stats from Administration > Plugins. You can track improvements at USGTRK-15.