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
WORKAROUND NOTE: if the dashboard page is slow, one workaround is to remove the "current subscription status" widget.
This gets really intense with 'Any Context' set for Organization. Loading the dashboard also blocks switching the context.
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.
Moving to POST since upstream bug http://projects.theforeman.org/issues/14723 has been closed
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
Created attachment 1170635 [details] Dashboard works fine
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