Bug #24576
closedImprove MonitorEventQueue performance for large workloads
Description
Cloned from https://bugzilla.redhat.com/show_bug.cgi?id=1614063
On systems with large numbers of registered hosts (20-50,000) there are cases when synchronization events may trigger large volume of entries landing in the katello_events table (40,000+ rows).
The majority of these rows are import_host_applicability events that need to be processed. This processing can often take hours and sometimes an entire day.
Due to load induced in processing all these events, there are times when foreman-tasks gets overloaded and may stop processing entirely and the queue ceases to drain.
We need to optimize the processing time of this queue of events to ensure they can be worked through in a faster manner than is being done now.
Some analysis has taken place that shows that a good portion of the work going through the katello_events table entries is SELECTS/INSERTS/UPDATES to the dynflow_steps table which can often take 100-300ms or more. We may update the routine to reduce this and perform other changes to make this task perform better.