Clean Up History, PublishQueue, and EventQueue tables in Sitecore

Many of the Sitecore developers might have come across this scenario where the size of the History or EventQueue or PublishQueue will be growing super fast. As a result, the entire site might become slow or you might experience the super slow performance of the content editor and page editor. So in this scenario How do we Clean Up History, PublishQueue, and EventQueue tables in Sitecore? Let’s take a look into this in detail.

Symptoms

  • Slow performance during publishing.
  • Slow performance during indexing.

Clean Up History, PublishQueue, and EventQueue tables in Sitecore

You could manually run the Query to delete the unnecessary records that have been accumulated in the Database tables. Run the below query to delete the records of History, PublishQueue, and EventQueue tables.

Sitecore recommends that the number of rows (entries) in the History, PublishQueue, and EventQueue tables be less than 1000. This prevents timeouts from occurring while the cleanup agents run.

Sitecore has a built in Scheduled Task which runs every 4 hours to clear the History, PublishQueue, and EventQueue tables automatically. If this setting is changed in web.config file then you could face this issue.

Verify the web.config file for the Default Settings

Open the web.config file and navigate to <configuration><sitecore><scheduling></scheduling> node.

  • Check that the is set to something other than 00:00:00 so that the agents are checked to see if they are ready to be executed.
  • Make sure that the interval for Sitecore.Tasks.CleanupHistory is greater than 00:00:00.
  • Check that the interval for Sitecore.Tasks.CleanupPublishQueue is greater than 00:00:00.
  • Check that the interval for Sitecore.Tasks.CleanupEventQueue is greater than 00:00:00.

If any of the values are set to 00:00:00 or changed to some other value then replace it with above default values. To improve the performance further, you could also reduce the DaysToKeep to 1 and interval to also.

You may also like...

Leave a Reply

Your email address will not be published. Required fields are marked *