Project

General

Profile

Bug #8954

Too many queries to list products - Satellite 6 - Slow Response Time

Added by Justin Sherrill about 8 years ago. Updated over 4 years ago.

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

Description

Cloned from https://bugzilla.redhat.com/show_bug.cgi?id=1171173
Description of problem:
When adding many products with many repos, listing the products performs too many queries which creates a slow response time for the API/UI.

Version-Release number of selected component (if applicable):
6.0.4

How reproducible:
Always

Steps to Reproduce:
1. Add 8 custom products
2. Add 21 repos per product
3. Sync repos (Not sure if this is necessary to reproduce)
4. time hammer product list --organization-id 1

Actual results:
  1. time h product list --organization-id 1
    ---|---------------------|-------------|----------------------|--------------|-----------
    ID | NAME | DESCRIPTION | ORGANIZATION | REPOSITORIES | SYNC STATE
    ---|---------------------|-------------|----------------------|--------------|-----------
    2 | perf-gen1 | | Default_Organization | 21 | finished
    5 | perf-gen4 | | Default_Organization | 21 | finished
    8 | perf-gen7 | | Default_Organization | 21 | finished
    3 | perf-gen2 | | Default_Organization | 21 | finished
    6 | perf-gen5 | | Default_Organization | 21 | finished
    9 | perf-gen8 | | Default_Organization | 21 | finished
    1 | perf-puppet-modules | | Default_Organization | 1 | not_synced
    4 | perf-gen3 | | Default_Organization | 21 | finished
    7 | perf-gen6 | | Default_Organization | 21 | finished
    ---|---------------------|-------------|----------------------|--------------|-----------

real 0m26.469s
user 0m2.318s
sys 0m0.526s

x 3 more:
0m26.022s
0m26.822s
0m25.895s

Expected results:
<3s to display 8 products, the number of associated repos and whether or not they have been synced.

Additional info:
The issue appears to be rooted with the shear number of queries to list the products:

$ grep i "select" production*.log c
production-hammer.log:2123
production-ui.log:2122
$ grep -i "cache" production
*.log -c
production-hammer.log:1537
production-ui.log:1535

Counting cached queries, we have 2123 queries to perform this.

Associated revisions

Revision 11eea886 (diff)
Added by Justin Sherrill about 8 years ago

fixes #8954 - speeding up product rabl rendering

This makes an api change to speed up rabl rendering
Given the scenario defined in the issue the speed up was from ~30 seconds to ~3.

Note that this makes an api change, but it is not possible to provide a meaningful speedup without the change

Revision 94f0cf11
Added by Justin Sherrill about 8 years ago

Merge pull request #4928 from jlsherrill/8954

fixes #8954 - speeding up product rabl rendering

History

#1 Updated by The Foreman Bot about 8 years ago

  • Status changed from New to Ready For Testing
  • Target version set to 63
  • Pull request https://github.com/Katello/katello/pull/4928 added
  • Pull request deleted ()

#2 Updated by Eric Helms about 8 years ago

  • Target version changed from 63 to 66

#3 Updated by Eric Helms about 8 years ago

  • Legacy Backlogs Release (now unused) set to 23
  • Triaged changed from No to Yes

#4 Updated by Eric Helms about 8 years ago

  • Target version changed from 66 to 67

#5 Updated by Justin Sherrill about 8 years ago

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

Also available in: Atom PDF