Bug 1796258

Summary: GET /owners/{owner_key}/pools is very slow
Product: Red Hat Satellite Reporter: matt jia <mjia>
Component: CandlepinAssignee: satellite6-bugs <satellite6-bugs>
Status: CLOSED ERRATA QA Contact: jcallaha
Severity: high Docs Contact:
Priority: unspecified    
Version: 6.6.0CC: bcourt, candlepin-bugs, csnyder, egolov, hyu, redakkan
Target Milestone: 6.7.0Keywords: Triaged
Target Release: Unused   
Hardware: All   
OS: All   
Whiteboard:
Fixed In Version: candlepin-2.9.25-1 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of:
: 1806574 (view as bug list) Environment:
Last Closed: 2020-04-14 13:28:34 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On: 1806574    
Bug Blocks:    

Description matt jia 2020-01-30 01:19:42 UTC
Description of problem:

In a Satellite environment where it has 2k+ hypervisors, it takes 15+ minutes to call this api to get a list for pools which is considerably slow.

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

candlepin-2.6.9-1.el7sat.noarch

How reproducible:

Easy

Steps to Reproduce:
1. set up a satellite server with 3k+ hypervisors. 
2. call the api

Actual results:

It takes 15min+ for the api to return all the pools.

Expected results:

It shouldn't take this long.

Comment 12 jcallaha 2020-03-12 17:26:15 UTC
Verified in Satellite 6.7 Snap 16.

I pushed my system beyond 5k hypervisors and got the following results:

irb(main):005:0> Benchmark.bm{|x| x.report{ Katello::Pool.get_for_owner('Default_Organization') }}
       user     system      total        real
   6.281571   0.585320   6.866891 ( 10.714442)
=> [#<Benchmark::Tms:0x000000002103d600 @label="", @real=10.714441663003527, @cstime=0.0, @cutime=0.0, @stime=0.5853199999999994, @utime=6.281571, @total=6.866890999999999>]

Comment 14 errata-xmlrpc 2020-04-14 13:28:34 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/RHSA-2020:1454