Project

General

Profile

Bug #20508

Extremely slow /api/v2/hosts, 200hosts/page takes about 40s to display

Added by Daniel Kimsey almost 5 years ago. Updated almost 4 years ago.

Status:
Closed
Priority:
Normal
Category:
Hosts
Target version:
Difficulty:
Triaged:
Bugzilla link:
Fixed in Releases:
Found in Releases:
Red Hat JIRA:

Description

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.

GET --api-v2-hosts-...-.txt GET --api-v2-hosts-...-.txt 920 KB Daniel Kimsey, 08/04/2017 03:49 PM

Associated revisions

Revision 59c52f67 (diff)
Added by Justin Sherrill almost 5 years ago

Fixes #20508 - cache applicability counts on content facet

History

#1 Updated by Daniel Kimsey almost 5 years ago

  • Subject changed from Extremely slow /api/v2/hosts, takes about 200hosts/page takes about 40s to Extremely slow /api/v2/hosts, 200hosts/page takes about 40s to display

#2 Updated by Justin Sherrill almost 5 years ago

These rpm and errata counts have been optimized quite a bit, i think the only thing left is to cache these values on the content_facet table.

#3 Updated by Justin Sherrill almost 5 years ago

  • Assignee set to Justin Sherrill
  • Target version set to 208
  • Legacy Backlogs Release (now unused) set to 250

#4 Updated by Brad Buckingham almost 5 years ago

  • Status changed from New to Assigned

#5 Updated by Denis Müller almost 5 years ago

Daniel Kimsey wrote:

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.

Did you follow the partitioning recommendations for host?
https://access.redhat.com/documentation/en-us/red_hat_satellite/6.2/html/installation_guide/preparing_your_environment_for_installation#hardware_storage_prerequisites

This did the boost for me.

#6 Updated by Brad Buckingham almost 5 years ago

  • Target version changed from 208 to 213

#7 Updated by Daniel Kimsey almost 5 years ago

Sorry for the delay, I wanted to go look on the host. But yes, we did follow the sizing guidelines. We are making some tweaks based on the Appendix A section regarding large deployments though I feel that will just affect our host's registration performance and the like.

#8 Updated by The Foreman Bot almost 5 years ago

  • Status changed from Assigned to Ready For Testing
  • Pull request https://github.com/Katello/katello/pull/6953 added

#9 Updated by Justin Sherrill almost 5 years ago

  • Bugzilla link set to 1491798

#10 Updated by Brad Buckingham almost 5 years ago

  • Target version changed from 213 to 217

#11 Updated by Justin Sherrill almost 5 years ago

  • Status changed from Ready For Testing to Closed
  • % Done changed from 0 to 100

Also available in: Atom PDF