Index flush trigger causes poor performance

Still need help?

The Atlassian Community is here for you.

Ask the community

Problem

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)

Diagnosis

  1. For versions prior to 3.1 only:
    1. Download the version-specific file of the zipped attachments on this page.
    2. Extract the contents to WEB-INF/classes/com/atlassian/confluence/search/lucene (you may need to create these directories).
  2. For all versions:
    1. 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

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 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.

Resolution

  1. 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.
  2. limit attachment size or attachment type
  3. For versions below Confluence 5.9, an option would be to change the index flush operation. For example, 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>
    





























Last modified on May 12, 2022

Was this helpful?

Yes
No
Provide feedback about this article
Powered by Confluence and Scroll Viewport.