Index flush trigger causes poor performance
Platform Notice: Data Center Only - This article only applies to Atlassian products on the Data Center platform.
Note that this KB was created for the Data Center version of the product. Data Center KBs 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
Summary
Problem
Performance is poor. Generating a Thread Dump contain threads like:
1
2
3
4
5
at $Proxy29.flushQueue(Unknown Source)
at com.atlassian.confluence.search.lucene.IndexQueueFlusher.executeJob(IndexQueueFlusher.java:30)
at com.atlassian.confluence.setup.quartz.AbstractClusterAwareQuartzJobBean.surroundJobExecutionWithLogging(AbstractClusterAwareQuartzJobBean.java:64)
at com.atlassian.confluence.setup.quartz.AbstractClusterAwareQuartzJobBean.executeInternal(AbstractClusterAwareQuartzJobBean.java:47)
at org.springframework.scheduling.quartz.QuartzJobBean.execute(QuartzJobBean.java:86)
Diagnosis
For versions prior to 3.1 only:
Download the version-specific file of the zipped attachments on this page.
Extract the contents to WEB-INF/classes/com/atlassian/confluence/search/lucene (you may need to create these directories).
For all versions:
Add a Configuring Logging for com.atlassian.confluence.search.lucene at level DEBUG.
When the queue next flushes you should see a line like:
1
[confluence.search.lucene.DefaultConfluenceIndexManager] flushQueue Flushed 10 items in 236 milliseconds
Cause
The index flush trigger is running. This may or may not be a problem. This is a normal operation of Confluence, and is only problematic if the operation is taking too long, as seen in the diagnosis. 5 or 6 seconds is probably too long.
If you're experiencing an outage, and seeing search, recently updated and blog posts macros are waiting (as visible from Generating a Thread Dump), assess what might be hitting the index hard. Some possible candidates:
Large attachments or pages or attachments added in bulk by the WebDav plugin.
Pages uploaded from the Remote API (assess your script)
The index flush operation can be exacerbated by page restrictions. See the Page Restrictions Performance Considerations page for more details.
Solution
Resolution
Avoid page restrictions on large page hierarchies, or disable page permissions completely. You can do this on a space-by-space basis by not granting the "Restrict" permission in the space permissions screen.
Configuring Attachment Size or How to disable indexing of attachments
For versions below Confluence 5.9, an option would be to (Archived) How do I modify the frequency of content indexing?. For example, change it to every five minutes:
1 2 3 4 5 6 7 8
<bean id="indexQueueFlushTrigger" class="org.springframework.scheduling.quartz.CronTriggerBean"> <property name="jobDetail"> <ref bean="indexQueueFlushJob"/> </property> <property name="cronExpression"> <value>0 0/5 * * * ?</value> </property> </bean>
Was this helpful?