Bugzilla will be upgraded to version 5.0. The upgrade date is tentatively scheduled for 2 December 2018, pending final testing and feedback.
Bug 1384199 - Host Collection widget takes too long to render
Host Collection widget takes too long to render
Status: CLOSED ERRATA
Product: Red Hat Satellite 6
Classification: Red Hat
Component: Dashboard (Show other bugs)
6.2.2
All Linux
urgent Severity urgent (vote)
: 6.2.4
: Unused
Assigned To: Chris Duryee
sthirugn@redhat.com
: PrioBumpGSS, Triaged
Depends On:
Blocks: 1385759
  Show dependency treegraph
 
Reported: 2016-10-12 15:26 EDT by Marcelo Moreira de Mello
Modified: 2017-05-10 04:33 EDT (History)
13 users (show)

See Also:
Fixed In Version: tfm-rubygem-katello-3.0.0.82-1
Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of:
: 1385759 (view as bug list)
Environment:
Last Closed: 2016-11-10 03:14:26 EST
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)


External Trackers
Tracker ID Priority Status Summary Last Updated
Red Hat Knowledge Base (Solution) 2695881 None None None 2016-10-12 15:42 EDT
Foreman Issue Tracker 16893 None None None 2016-10-12 15:39 EDT
Red Hat Product Errata RHBA-2016:2699 normal SHIPPED_LIVE Satellite 6.2.4 Async Bug Release 2016-11-10 08:12:22 EST

  None (edit)
Description Marcelo Moreira de Mello 2016-10-12 15:26:55 EDT
Description of problem:

On large databases, host collection widget takes too long to render. 

We created a test ruby script to simulate and trace the same steps performed by the host collection widget and look at the results:


[root@inhas62145 ~]# cat /tmp/host_collection_widget.rb 
start_time = Time.now
puts "Start time #{start_time}"

User.current = User.anonymous_api_admin

query_start = Time.now
organizations = Organization.current.present? ? [Organization.current] : User.current.allowed_organizations
query_end = Time.now

puts "Organizations query #{query_end - query_start}"
puts "-------------"

query_start = Time.now
critical, warning, ok = Katello::HostCollection.lists_by_updates_needed(organizations)
query_end = Time.now
puts "host_collection list  query #{query_end - query_start}"
puts "-------------"

query_start = Time.now
host_collections = (critical + warning + ok)[0..6]
query_end = Time.now
puts "host_coolections top 0...6 query #{query_end - query_start}"
puts "-------------"

end_time = Time.now
elapsed_time = end_time - start_time
puts "End time #{end_time}"
puts "Elapsed time #{elapsed_time}"
puts "-------------"


irb(main):001:0> load '/tmp/host_collection_widget.rb'
Start time 2016-10-12 14:49:41 -0400
Organizations query 0.003659478
-------------
host_collection list  query 50.057783585
-------------
host_coolections top 0...6 query 4.094e-06
-------------
End time 2016-10-12 14:50:31 -0400
Elapsed time 50.093940405
-------------
=> true
irb(main):002:0> exit


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

How reproducible:
100% with large databases

Steps to Reproduce:
1. Launch dashboard with host_collection widget


Actual results:

 Slow to render widget

Expected results:

 Should return on a reasonable time
Comment 3 Bryan Kearney 2016-10-12 16:09:10 EDT
Upstream bug component is Dashboard
Comment 4 Bryan Kearney 2016-10-13 14:09:31 EDT
Moving this bug to POST for triage into Satellite 6 since the upstream issue http://projects.theforeman.org/issues/16893 has been resolved.
Comment 9 sthirugn@redhat.com 2016-11-09 07:59:32 EST
Verified in Satellite 6.2.4.  The response times look great.

Note that the Dashboard loading time is still 22 seconds+ but it may be potentially due to other widgets? I am happy to share my setup with a dev if needed to poke around and find other slow loading widgets.  But the host collection widget (had great response time using the script given in the original bug description.  The host collections page loaded fast as well.

Note: This setup had 51 host collections (see screenshot) with each of them containing multiple hosts.  The host collections with large number of hosts are:


# foreman-rake console
/usr/share/foreman/lib/tasks/console.rake:4: warning: already initialized constant ARGV
Loading production environment (Rails 4.1.5)
irb(main):001:0> load '/tmp/host_collection_widget.rb'
Start time 2016-11-09 07:47:10 -0500
Organizations query 0.001516253
-------------
host_collection list  query 0.692292217
-------------
host_coolections top 0...6 query 5.582e-06
-------------
End time 2016-11-09 07:47:11 -0500
Elapsed time 0.706627082
-------------
=> true

Also attached the screenshot of Dashboard.
Comment 13 errata-xmlrpc 2016-11-10 03:14:26 EST
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:2699

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