Project

General

Profile

Actions

Bug #8954

closed

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

Added by Justin Sherrill about 9 years ago. Updated over 5 years ago.

Status:
Closed
Priority:
Normal
Category:
API
Target version:
Difficulty:
Triaged:
Yes
Fixed in Releases:
Found in Releases:

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.

Actions #1

Updated by The Foreman Bot about 9 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 ()
Actions #2

Updated by Eric Helms about 9 years ago

  • Target version changed from 63 to 66
Actions #3

Updated by Eric Helms about 9 years ago

  • translation missing: en.field_release set to 23
  • Triaged changed from No to Yes
Actions #4

Updated by Eric Helms about 9 years ago

  • Target version changed from 66 to 67
Actions #5

Updated by Justin Sherrill about 9 years ago

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

Also available in: Atom PDF