Red Hat Satellite engineering is moving the tracking of its product development work on Satellite to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "Satellite project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs will be migrated starting at the end of May. If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "Satellite project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/SAT-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.
Bug 1422304 - host API call for specific host takes a long time with many hosts registered
Summary: host API call for specific host takes a long time with many hosts registered
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Satellite
Classification: Red Hat
Component: Hosts
Version: 6.2.7
Hardware: Unspecified
OS: Unspecified
high
high
Target Milestone: Unspecified
Assignee: Daniel Lobato Garcia
QA Contact: Roman Plevka
URL:
Whiteboard:
Depends On:
Blocks: 1426422
TreeView+ depends on / blocked
 
Reported: 2017-02-15 00:49 UTC by Chris Duryee
Modified: 2020-08-13 08:52 UTC (History)
9 users (show)

Fixed In Version: foreman-1.11.0.72-1
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
: 1426422 (view as bug list)
Environment:
Last Closed: 2017-05-01 14:00:07 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)
listing times per 20hpp (45.03 KB, image/png)
2017-04-24 16:37 UTC, Roman Plevka
no flags Details
listing times per 100hpp (41.45 KB, image/png)
2017-04-24 16:38 UTC, Roman Plevka
no flags Details
listing times per 1000hpp (55.91 KB, image/png)
2017-04-24 16:38 UTC, Roman Plevka
no flags Details


Links
System ID Private Priority Status Summary Last Updated
Foreman Issue Tracker 15527 0 None None None 2017-02-15 00:49:38 UTC
Red Hat Product Errata RHBA-2017:1191 0 normal SHIPPED_LIVE Satellite 6.2.9 Async Bug Release 2017-05-01 17:49:42 UTC

Description Chris Duryee 2017-02-15 00:49:39 UTC
Description of problem:

If you have a large number of hosts registered (perhaps 40K or more), the following call can take minutes:

/api/v2/hosts/<host>

This only occurs if you are *not* using an admin account.

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


How reproducible: every time


Steps to Reproduce:
1. create non-admin account with permissions to view hosts
2. register a large number of systems. They do not have to be checking in.
3. perform GET on url listed above

Actual results: minutes for GET to return


Expected results:  seconds for GET to return

Comment 2 Satellite Program 2017-02-15 01:04:23 UTC
Upstream bug assigned to dlobatog

Comment 3 Satellite Program 2017-02-15 01:04:25 UTC
Moving this bug to POST for triage into Satellite 6 since the upstream issue http://projects.theforeman.org/issues/15527 has been resolved.

Comment 6 Satellite Program 2017-02-23 21:11:56 UTC
Please add verifications steps for this bug to help QE verify

Comment 7 Daniel Lobato Garcia 2017-02-27 10:02:31 UTC
To verify, simply try the calls described above on Chris Duryee's comment 4 - https://bugzilla.redhat.com/show_bug.cgi?id=1422304#c4 and measure the before/after times.

Comment 8 Roman Plevka 2017-04-24 16:36:28 UTC
here's some time measurements of host listing with variable per_page argument for a satellite 6.2.9-4 having about 65k hosts registered. The Y axis represents the time taken to get the response:


 00:40 +++--+-+-+--+-+-+--+-+-+--+-+-+--+-+--+-+-+--+-+-+--+-+-+--+-+-+--+**   
       +++  + + +  + + +  + + +  + + +  + +  + + +  + + *****+************++   
 00:35 +-+.............................................*.....*.foo.*******-+   
       ++:  : : :  : : :  : : :  : : :  : :  : :******* :  : : :  : : :  :++   
 00:30 +-+...............................*******.........................+-+   
       ++:  : : :  : : :  : :************ :  : : :  : : :  : : :  : : :  :++   
       ++:  : : :  : : :  *** :  : : :  : :  : : :  : : :  : : :  : : :  :++   
 00:25 +++..............**...............................................+++   
       ++:  : : :  : :**  : : :  : : :  : :  : : :  : : :  : : :  : : :  :++   
 00:20 +++..........**...................................................+++   
       ++:  : : :  * : :  : : :  : : :  : :  : : :  : : :  : : :  : : :  :++   
 00:15 +-+.......**......................................................+-+   
       ++:  : :**  : : :  : : :  : : :  : :  : : :  : : :  : : :  : : :  :++   
 00:10 +-+...**..........................................................+-+   
       ++: ** : :  : : :  : : :  : : :  : :  : : :  : : :  : : :  : : :  :++   
       +*** : : :  : : :  : : :  : : :  : :  : : :  : : :  : : :  : : :  :++   
 00:05 *++...............................................................+++   
       +++  + + +  + + +  + + +  + + +  + +  + + +  + + +  + + +  + + +  +++   
 00:00 +-+--+-+-+--+-+-+--+-+-+--+-+-+--+-+--+-+-+--+-+-+--+-+-+--+-+-+--+-+   
       2 40 6  10 1 1 16 1 2 22 2 2 28 3 32 3 3 38 4 4 44 4 4 50 5 5 56 5 600  
                                     per page                                


 07:00 +-++---+--+---+--+--+---+--+---+--+--+---+--+---+--+--+---+--+---++-+   
       ++ +   +  +   +  +  +   +  +   +  +  +   +  +   +  +  +   +  +   + **   
       ++ :   :  :   :  :  :   :  :   :  :  :   :  :   :  :  : foo *******++   
 06:00 +++..........................................................**...+++   
       ++ :   :  :   :  :  :   :  :   :  :  :   :  :   :  :  :   :**:   : ++   
 05:00 +-+.....................................................***.......+-+   
       ++ :   :  :   :  :  :   :  :   :  :  :   :  :   :  :  **  :  :   : ++   
       ++ :   :  :   :  :  :   :  :   :  :  :   :  :   :  :**:   :  :   : ++   
 04:00 +-+................................................*..............+-+   
       ++ :   :  :   :  :  :   :  :   :  :  :   :  :   :**:  :   :  :   : ++   
 03:00 +-+...........................................***.................+-+   
       ++ :   :  :   :  :  :   :  :   :  :  :   :  **  :  :  :   :  :   : ++   
       ++ :   :  :   :  :  :   :  :   :  :  :   :**:   :  :  :   :  :   : ++   
 02:00 +-+....................................***........................+-+   
       ++ :   :  :   :  :  :   :  :   : ******  :  :   :  :  :   :  :   : ++   
 01:00 +-+.......................*******.................................+-+   
       ++ :   :  : ************** :   :  :  :   :  :   :  :  :   :  :   : ++   
       ************  +  +  +   +  +   +  +  +   +  +   +  +  +   +  +   + ++   
 00:00 +-++---+--+---+--+--+---+--+---+--+--+---+--+---+--+--+---+--+---++-+   
      10 200 30 400 50 60 700 80 900 10 11 120 13 140 15 16 170 18 190 20 2100 
                                     per page                                  


 27:00 +-+---+-----+------+-----+-----+-----+-----+-----+------+-----*---+-+   
       ++    +     +      +     +     +     +     +     +      +    *+*   ++   
 24:00 +-+.....................................................foo.*******-+   
       ++    :     :      :     :     :     :     :     :      :  *  : *  ++   
 21:00 +-+.......................................................*......*+-+   
       ++    :     :      :     :     :     :  ****     :      :*    :   *++   
 18:00 +-+.................................****....*...........*.........+*+   
       ++    :     :      :     :     : *** :     : *   :     *:     :    *+   
 15:00 +-+.........................*****............*........*...........+-*   
       ++    :     :      :    ****   :     :     :  *  :   *  :     :    ++   
 12:00 +-+..................***.......................*....*.............+-+   
       ++    :     :   *****    :     :     :     :    *: *    :     :    ++   
 09:00 +-+........*****................................*.*...............+-+   
       ++    : *** :      :     :     :     :     :     *      :     :    ++   
 06:00 +-+..***..........................................................+-+   
       ++ ** :     :      :     :     :     :     :     :      :     :    ++   
 03:00 +**...............................................................+-+   
       *+    +     +      +     +     +     +     +     +      +     +    ++   
 00:00 +-+---+-----+------+-----+-----+-----+-----+-----+------+-----+---+-+   
      1000  2000  3000   4000  5000  6000  7000  8000  9000  10000 11000 12000 
                                     per page                                  

^ note that the sudden drop in the above chart has been most probably caused by timeout.

Comment 9 Roman Plevka 2017-04-24 16:37:32 UTC
Created attachment 1273649 [details]
listing times per 20hpp

Comment 10 Roman Plevka 2017-04-24 16:38:05 UTC
Created attachment 1273650 [details]
listing times per 100hpp

Comment 11 Roman Plevka 2017-04-24 16:38:35 UTC
Created attachment 1273651 [details]
listing times per 1000hpp

Comment 12 Roman Plevka 2017-04-24 16:42:34 UTC
the xlabel of the first 2 plots got scrumbled-
the first chart contains the range (20,40,60,80,...,600)
the second one contains (100,200,300,...,1200)

Comment 14 errata-xmlrpc 2017-05-01 14:00:07 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/RHBA-2017:1191


Note You need to log in before you can comment on or make changes to this bug.