Bug 1614063 - Improve MonitorEventQueue performance for large workloads
Summary: Improve MonitorEventQueue performance for large workloads
Alias: None
Product: Red Hat Satellite 6
Classification: Red Hat
Component: Content Management
Version: 6.3.2
Hardware: Unspecified
OS: Unspecified
high vote
Target Milestone: 6.4.0
Assignee: Justin Sherrill
QA Contact: sbadhwar
: 1622206 (view as bug list)
Depends On:
TreeView+ depends on / blocked
Reported: 2018-08-08 22:35 UTC by Mike McCune
Modified: 2019-11-05 23:32 UTC (History)
6 users (show)

Fixed In Version: tfm-rubygem-katello-
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
: 1622206 (view as bug list)
Last Closed: 2018-10-16 19:04:30 UTC
Target Upstream Version:

Attachments (Terms of Use)

System ID Priority Status Summary Last Updated
Foreman Issue Tracker 24576 Normal Closed Improve MonitorEventQueue performance for large workloads 2020-04-21 15:38:40 UTC

Description Mike McCune 2018-08-08 22:35:42 UTC
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.

Comment 2 Justin Sherrill 2018-08-09 20:19:03 UTC
Created redmine issue https://projects.theforeman.org/issues/24576 from this bug

Comment 3 pm-sat@redhat.com 2018-08-09 22:10:21 UTC
Upstream bug assigned to jsherril@redhat.com

Comment 4 pm-sat@redhat.com 2018-08-09 22:10:24 UTC
Upstream bug assigned to jsherril@redhat.com

Comment 6 pm-sat@redhat.com 2018-08-20 16:10:45 UTC
Moving this bug to POST for triage into Satellite 6 since the upstream issue https://projects.theforeman.org/issues/24576 has been resolved.

Comment 11 Mike McCune 2018-09-11 14:59:37 UTC
To test a large amount of data for the MonitorEventQueue to process you can do the following:

1) Load data to be processed by the queue:

# foreman-rake console

> 1.times { Katello::Host::ContentFacet.pluck(:host_id).each { |id|::Katello::EventQueue.push_event(::Katello::Events::ImportHostApplicability::EVENT_TYPE, id)}  }

Once this completes, monitor progress in the UI on the task details, it will indicate the # of rows processed

2) You can also monitor the count in the database:

# sudo -u postgres psql -d foreman -c 'select count(*) from katello_events;'  

(1 row)

Once that reaches 0 the processing is complete.  

We measured between 30-40% speed improvements in processing items in this queue before this bugfix and after.

Comment 13 Mike McCune 2018-09-20 20:12:48 UTC
*** Bug 1622206 has been marked as a duplicate of this bug. ***

Comment 14 Bryan Kearney 2018-10-16 19:04:30 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.


Note You need to log in before you can comment on or make changes to this bug.