High CPU usage, high memory use, or repeated restarts can occur when the EventQueue table in the Master or Web database grows considerably. Cleanup of the queue can then fail with timeout errors, and on Azure App Service the Event Queue Statistics page can time out before the cleanup finishes. The issue can be more likely when the rate of item changes is high or when average event entries are large.
Timeout expired. The timeout period elapsed prior to completion of the operation or the server is not responding.
To mitigate the issue and reduce future EventQueue growth, perform the following:
TRUNCATE TABLE [EventQueue]
<?xml version="1.0" encoding="utf-8"?>
<configuration xmlns:patch="http://www.sitecore.net/xmlconfig/" xmlns:set="http://www.sitecore.net/xmlconfig/set/" xmlns:role="http://www.sitecore.net/xmlconfig/role/">
<sitecore>
<settings>
<setting name="InstanceName" value="CM" role:require="ContentManagement" />
</settings>
<scheduling>
<agent type="Sitecore.Tasks.CleanupEventQueue, Sitecore.Kernel" set:interval="01:00:00" role:require="ContentManagement">
<DaysToKeep>
<patch:delete />
</DaysToKeep>
<IntervalToKeep>04:00:00</IntervalToKeep>
</agent>
</scheduling>
</sitecore>
</configuration>
Note: If a large queue was cleared directly in the database, rebuilding the search indexes for the affected database is recommended.