Index flush trigger causes poor performance
Performance is poor. Thread dumps contain threads like:
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)
- 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 Logging and Profiling setting for com.atlassian.confluence.search.lucene at level DEBUG.
When the queue next flushes you should see a line like:
[confluence.search.lucene.DefaultConfluenceIndexManager] flushQueue Flushed 10 items in 236 milliseconds
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 thread dumps), 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.
- 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.
- limit attachment size or attachment type
An option would be to change the index flush operation. For example, to change it to every five minutes:
<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>