Bug 1491798

Summary: Extremely slow /api/v2/hosts, 200hosts/page takes about 40s to display
Product: Red Hat Satellite Reporter: Justin Sherrill <jsherril>
Component: Hosts - ContentAssignee: Justin Sherrill <jsherril>
Status: CLOSED ERRATA QA Contact: Roman Plevka <rplevka>
Severity: medium Docs Contact:
Priority: unspecified    
Version: 6.2.0CC: bbuckingham, ehelms
Target Milestone: UnspecifiedKeywords: Triaged
Target Release: Unused   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2018-02-21 16:54:37 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Justin Sherrill 2017-09-14 17:29:28 UTC
I noticed this when l try to pull up the content hosts view or when I was using the foreman plugin for ansible.

In short, the @/api/v2/hosts@ call takes a very long time. With jsherril's help I've extracted some debug logs (attached). It looks like most of the SQL time is spent in lookups to rpms and errata with some more in reports.

Comment 1 Justin Sherrill 2017-09-14 17:29:33 UTC
Created from redmine issue http://projects.theforeman.org/issues/20508

Comment 2 Justin Sherrill 2017-09-14 17:29:37 UTC
Upstream bug assigned to jsherril

Comment 3 Justin Sherrill 2017-09-14 17:31:16 UTC
suggesting for 6.3, as it should help performance on the hosts api and pages.

Comment 5 Satellite Program 2017-09-19 14:03:29 UTC
Moving this bug to POST for triage into Satellite 6 since the upstream issue http://projects.theforeman.org/issues/20508 has been resolved.

Comment 6 Satellite Program 2018-02-21 16:54:37 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.
> > 
> > https://access.redhat.com/errata/RHSA-2018:0336