Bug 1271221 - API Listing repositories slow, 24 repositories of redhat server product takes 30 seconds
Summary: API Listing repositories slow, 24 repositories of redhat server product takes...
Alias: None
Product: Red Hat Satellite
Classification: Red Hat
Component: Content Management
Version: 6.1.2
Hardware: Unspecified
OS: Unspecified
Target Milestone: Unspecified
Assignee: Justin Sherrill
QA Contact: jcallaha
URL: http://projects.theforeman.org/issues...
Depends On:
Blocks: 1122832
TreeView+ depends on / blocked
Reported: 2015-10-13 12:10 UTC by Peter Vreman
Modified: 2019-09-25 21:16 UTC (History)
5 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Last Closed: 2016-07-27 09:19:46 UTC
Target Upstream Version:

Attachments (Terms of Use)

System ID Private Priority Status Summary Last Updated
Foreman Issue Tracker 13923 0 None None None 2016-04-26 16:56:18 UTC
Red Hat Bugzilla 1271160 0 unspecified CLOSED API Listing products slow, 36 products takes 50+ seconds 2021-02-22 00:41:40 UTC
Red Hat Product Errata RHBA-2016:1501 0 normal SHIPPED_LIVE Red Hat Satellite 6.2 Capsule and Server 2016-07-27 12:28:58 UTC

Internal Links: 1271160

Description Peter Vreman 2015-10-13 12:10:14 UTC
Description of problem:
Using the API to list repositories is slow. Rendering the view of 24 repositories of the redhat server product takes 30 seconds:

time curl -K /opt/hoici/etc/sat6/curl-hoici.conf "-HContent-Type: application/json" "-d{\"per_page\":9999,\"organization_id\":3,\"product_id\":14}" -XGET https://localhost/katello/api/v2/repositories > p.json

real    0m34.105s
user    0m0.178s
sys     0m0.054s

[crash] root@li-lc-1578:~# hoi-json p.json --get results.id | wc -l

2015-10-13 12:00:50 [I] Processing by Katello::Api::V2::RepositoriesController#index as */*
2015-10-13 12:00:50 [I]   Parameters: {"per_page"=>9999, "organization_id"=>3, "product_id"=>14, "api_version"=>"v2", "repository"=>{"product_id"=>14}}
2015-10-13 12:00:51 [I] Authorized user hoici(hoici )
2015-10-13 12:01:23 [I]   Rendered /opt/rh/ruby193/root/usr/share/gems/gems/katello- within katello/api/v2/layouts/collection (28697.1ms)

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

How reproducible:

Steps to Reproduce:
1. Enable 25 repositories under RedHat Server product
2. List repositories through API

Actual results:
Listing takes 30 seconds

Expected results:
Listing takes <5 seconds

Additional info:

Comment 1 Peter Vreman 2015-10-13 12:10:26 UTC
Sync plans are not used, as mentioned in the a related BZ1253802

Comment 2 Peter Vreman 2015-10-13 12:10:51 UTC
See also BZ1271160 for products listing, that might be related

Comment 4 Justin Sherrill 2016-02-26 23:48:17 UTC
Connecting redmine issue http://projects.theforeman.org/issues/10208 from this bug

Comment 5 Bryan Kearney 2016-02-27 01:02:33 UTC
Upstream bug component is Content Management

Comment 7 Justin Sherrill 2016-02-27 03:01:12 UTC
Connecting redmine issue http://projects.theforeman.org/issues/13923 from this bug

Comment 8 Justin Sherrill 2016-02-27 03:23:01 UTC
For some comparison with this change.  On 6.2 (katello 3.0) i was able to list 
~20 Red Hat Repositories (all RHEL 6.X and 7.X repos) in 500-1500ms.  

When I upped that to 36 repos (adding more RHEL 6.x and RHEV agent repos) it went a bit higher to 4000-5000ms.

Comment 10 jcallaha 2016-04-29 12:56:44 UTC
Verified in Satellite 6.2 Beta RC. Listing over 50 repositories of a product took 7 seconds. ~20 repositories took just over 2 seconds.

time curl -k -u admin:<passowrd> -H "Content-Type: application/json" -d '{"per_page":9999,"organization_id":1,"product_id":9}' -XGET https://rhsm-qe-1.rhq.lab.eng.bos.redhat.com/katello/api/v2/repositories

real	0m7.124s
user	0m0.031s
sys	0m0.061s

Comment 11 Peter Vreman 2016-06-29 14:49:08 UTC
Confirmed on Sat6.2.0 Beta2

For 19 repos:

[crash] root@li-lc-1578:~# time curl -K /opt/hoici/etc/sat6/curl-hoici.conf "-HContent-Type: application/json" "-d{\"per_page\":9999,\"organization_id\":3,\"product_id\":14}" -XGET https://localhost/katello/api/v2/repositories > p.json

real    0m5.266s
user    0m0.041s
sys     0m0.066s

The output is strange regading the sync_plan part, it contains an Array with for the end-user useless information:

      "name": "Red Hat Enterprise Linux 6 Server RPMs x86_64 6Server",
      "label": "Red_Hat_Enterprise_Linux_6_Server_RPMs_x86_64_6Server",
      "product": {
        "sync_plan": [
        "name": "Red Hat Enterprise Linux Server",
        "cp_id": "69",
        "id": 14
      "last_sync": {
        "progress": 1,

Comment 13 errata-xmlrpc 2016-07-27 09:19:46 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.