Platform Administration and Architecture

Clean up the EventQueue and PublishQueue tables

Abstract

How to optimize performance by cleaning up the Sitecore EventQueue and PublishQueue tables.

Applies to

Content Management, Content Delivery, xDB Processing, and xDB Reporting.

You might experience performance issues when the EventQueue and PublishQueue tables grow too large. Sitecore can clean up these tables on demand or automatically.

The EventQueue table is used to share events between instances - mainly during index updates and cache clearing. Normally, 4 hours is enough to process new entries.

The PublishQueue table is used for incremental publishing. If you do not use incremental publishing, you can configure the CleanupPublishQueue task to run more frequently.

Note

The CleanupEventQueue and CleanupPublishQueue tasks are not relevant on Content Delivery, xDB Processing, and xDB Reporting instances. You can remove their configuration or set their interval to 0 so that they exist but never run. If your installation uses more than one Content Management instance, you must configure each one separately.

Clean up the EventQueue table on-demand

To perform an on-demand cleanup of the EventQueue table:

  1. Click Control Panel, Administration tools, and Event Queue Statistics.

  2. In the Cleanup EventQueue pane, select the database and interval and click Cleanup.

Configure automatic cleanup of the EventQueue table

To configure automatic cleanup of the EventQueue table:

  1. Open the App_Config/Sitecore.config file.

  2. Locate the Sitecore.Tasks.CleanupEventQueue section:

    <agent type="Sitecore.Tasks.CleanupEventQueue, Sitecore.Kernel" method="Run" interval="04:00:00">
      <DaysToKeep>1</DaysToKeep>
      [<IntervalToKeep>hh:mm:ss</IntervalToKeep>]
    </agent>
  3. To specify how often the cleanup task runs, edit the interval attribute.

  4. To specify how many days entries are kept, edit the DaysToKeep tag.

  5. To specify how many hours, minutes, and seconds the entries are kept, edit the IntervalToKeep tag. The IntervalToKeep tag overrides the DaysToKeep tag.

Clean up the PublishQueue table on-demand

To perform an on-demand cleanup of the PublishQueue table:

  1. Click Control Panel, Administration tools, and Publish Queue Statistics.

  2. In the Cleanup PublishQueue pane, select the database and interval and click Cleanup.

Configure automatic cleanup of the PublishQueue table

To configure automatic cleanup of the PublishQueue table:

  1. Open the App_Config/Sitecore.config file.

  2. Locate the Sitecore.Tasks.CleanupPublishQueue section:

    <agent type="Sitecore.Tasks.CleanupPublishQueue, Sitecore.Kernel" method="Run" interval="04:00:00">
      <DaysToKeep>30</DaysToKeep>
    </agent>
  3. To specify how often the cleanup task runs, edit the interval attribute.

  4. To specify how many days entries are kept, edit the DaysToKeep tag.