Bugzilla will be upgraded to version 5.0. The upgrade date is tentatively scheduled for 2 December 2018, pending final testing and feedback.
Bug 1422304 - host API call for specific host takes a long time with many hosts registered
host API call for specific host takes a long time with many hosts registered
Status: CLOSED ERRATA
Product: Red Hat Satellite 6
Classification: Red Hat
Component: Hosts (Show other bugs)
6.2.7
Unspecified Unspecified
high Severity high (vote)
: 6.2.9
: Unused
Assigned To: Daniel Lobato Garcia
Roman Plevka
: Performance, PrioBumpField, Triaged
Depends On:
Blocks: 1426422
  Show dependency treegraph
 
Reported: 2017-02-14 19:49 EST by Chris Duryee
Modified: 2017-05-01 10:00 EDT (History)
9 users (show)

See Also:
Fixed In Version: foreman-1.11.0.72-1
Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of:
: 1426422 (view as bug list)
Environment:
Last Closed: 2017-05-01 10:00:07 EDT
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


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


External Trackers
Tracker ID Priority Status Summary Last Updated
Foreman Issue Tracker 15527 None None None 2017-02-14 19:49 EST
Red Hat Product Errata RHBA-2017:1191 normal SHIPPED_LIVE Satellite 6.2.9 Async Bug Release 2017-05-01 13:49:42 EDT

  None (edit)
Description Chris Duryee 2017-02-14 19:49:39 EST
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 pm-sat@redhat.com 2017-02-14 20:04:23 EST
Upstream bug assigned to dlobatog@redhat.com
Comment 3 pm-sat@redhat.com 2017-02-14 20:04:25 EST
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 pm-sat@redhat.com 2017-02-23 16:11:56 EST
Please add verifications steps for this bug to help QE verify
Comment 7 Daniel Lobato Garcia 2017-02-27 05:02:31 EST
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 12:36:28 EDT
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 12:37 EDT
Created attachment 1273649 [details]
listing times per 20hpp
Comment 10 Roman Plevka 2017-04-24 12:38 EDT
Created attachment 1273650 [details]
listing times per 100hpp
Comment 11 Roman Plevka 2017-04-24 12:38 EDT
Created attachment 1273651 [details]
listing times per 1000hpp
Comment 12 Roman Plevka 2017-04-24 12:42:34 EDT
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 10:00:07 EDT
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.