Note: This bug is displayed in read-only format because
the product is no longer active in Red Hat Bugzilla.
Red Hat Satellite engineering is moving the tracking of its product development work on Satellite to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "Satellite project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs will be migrated starting at the end of May. If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "Satellite project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/SAT-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.
DescriptionMarcelo Moreira de Mello
2016-10-12 19:26:55 UTC
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 9sthirugn@redhat.com
2016-11-09 12:59:32 UTC
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.
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
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