Bug 1328627 - as the number of subs increases, dashboard page gets slower
Summary: as the number of subs increases, dashboard page gets slower
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Satellite 6
Classification: Red Hat
Component: Performance
Version: 6.2.0
Hardware: Unspecified
OS: Unspecified
high
high vote
Target Milestone: Unspecified
Assignee: Chris Duryee
QA Contact: Lukas Zapletal
URL: http://projects.theforeman.org/issues...
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2016-04-19 22:05 UTC by Chris Duryee
Modified: 2019-04-01 20:27 UTC (History)
6 users (show)

Fixed In Version: rubygem-katello-3.0.0.31-1,rubygem-katello-3.0.0.31-1
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2016-07-27 11:41:54 UTC


Attachments (Terms of Use)
Dashboard works fine (309.73 KB, image/png)
2016-06-22 08:34 UTC, Lukas Zapletal
no flags Details


Links
System ID Priority Status Summary Last Updated
Foreman Issue Tracker 14723 None None None 2016-04-22 16:02:35 UTC

Description Chris Duryee 2016-04-19 22:05:04 UTC
Description of problem:

As the number of subscriptions increase, the "current subscription status" widget on the dashboard gets slower to load. It makes 1-2 calls to candlepin per subscription. Ideally the page would take 3-4 seconds to load, no matter how many subscriptions are in the loaded manifest.

An alternative way to populate the widget would be to call candlepin to get all of the pools for the org at once, and then loop over that to build the data. That would avoid the number of candlepin calls scaling as the number of subs increases.

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

Comment 2 Chris Duryee 2016-04-25 13:27:34 UTC
WORKAROUND NOTE: if the dashboard page is slow, one workaround is to remove the "current subscription status" widget.

Comment 3 Roman Plevka 2016-05-10 15:03:35 UTC
This gets really intense with 'Any Context' set for Organization.
Loading the dashboard also blocks switching the context.

Comment 4 Chris Duryee 2016-05-10 18:47:57 UTC
The upstream patch should save some time off of the dashboard. However if you have many, many orgs, it will still be somewhat slow. At best, we need to make one call to candlepin per org to find the number of active pools for each org.

Comment 5 Bryan Kearney 2016-05-11 14:15:54 UTC
Moving to POST since upstream bug http://projects.theforeman.org/issues/14723 has been closed

Comment 6 Lukas Zapletal 2016-06-22 08:34:09 UTC
Verified on snap 15:

[root@tyan-gt24-03 ~]# rpm -q satellite katello foreman
satellite-6.2.0-15.1.beta.el7sat.noarch
katello-3.0.0-8.el7sat.noarch
foreman-1.11.0.38-1.el7sat.noarch

[root@tyan-gt24-03 ~]# grep reduce /opt/theforeman/tfm/root/usr/share/gems/gems/katello-3.0.0.49/app/views/dashboard/_subscription_status_widget.html.erb
<% total_active_subscriptions = organizations.map {|org| org.active_pools_count}.reduce(:+) %>

Instead of subscriptions-all call, there is now get of /candlepin/owners/MyOrg/pools?attribute=unmapped_guests_only:!true

I am not measuring how much faster this is, the key here is it works as expected and dashboard works fine (attaching PNG image).

2016-06-22 04:30:24,325 [thread=http-bio-8443-exec-2] [req=7139e66b-6bda-410a-94a8-4aab0a0498f8, org=] INFO  org.candlepin.common.filter.LoggingFilter - Request: verb=GET, uri=/candlepin/owners/MyOrg/info
2016-06-22 04:30:24,580 [thread=http-bio-8443-exec-2] [req=7139e66b-6bda-410a-94a8-4aab0a0498f8, org=MyOrg] INFO  org.candlepin.common.filter.LoggingFilter - Response: status=200, content-type="application/json", time=255
2016-06-22 04:30:24,630 [thread=http-bio-8443-exec-9] [req=f961e147-04bb-4e8e-9498-36c07df3cfc5, org=] INFO  org.candlepin.common.filter.LoggingFilter - Request: verb=GET, uri=/candlepin/owners/MyOrg/pools?attribute=unmapped_guests_only:!true
2016-06-22 04:30:24,923 [thread=http-bio-8443-exec-9] [req=f961e147-04bb-4e8e-9498-36c07df3cfc5, org=MyOrg] INFO  org.candlepin.common.filter.LoggingFilter - Response: status=200, content-type="application/json", time=294

Comment 7 Lukas Zapletal 2016-06-22 08:34:35 UTC
Created attachment 1170635 [details]
Dashboard works fine

Comment 8 Bryan Kearney 2016-07-27 11:41:54 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-2016:1501


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