Project

General

Profile

Bug #16238

dashboard widget for latests events can be exteramlly slow

Added by Ohad Levy over 4 years ago. Updated over 2 years ago.

Status:
Closed
Priority:
Normal
Assignee:
Category:
Performance
Target version:
Difficulty:
Triaged:
Bugzilla link:
Fixed in Releases:
Found in Releases:

Description

when having many hosts, the latest event widget can take around a minute to load.

the line in question is most likely the issue:

 def latest_events
    # 9 reports + header fits the events box nicely...
    @latest_events ||= ConfigReport.authorized(:view_config_reports).my_reports.interesting.where(:host_id => hosts.pluck(:id)).search_for('reported > "7 days ago"').limit(9).includes(:host)
 end

Related issues

Related to Foreman - Bug #16044: Errors in individual dashboard widgets fail entire pageClosed2016-08-10
Related to Foreman - Bug #16627: Puppet general tab new error on 1.12.3Closed2016-09-20
Related to Foreman - Bug #16704: Searching fails on dashboardClosed2016-09-27
Related to Foreman - Bug #18893: dashboard widget for puppet report latest events can be very slow on large amount of reportsClosed2017-03-14

Associated revisions

Revision 95fd95ea (diff)
Added by Ohad Levy over 4 years ago

Fixes #16238 - Speed up dashboard loading time.

I've change report host to inner query and used a join, in
my testing, this speed up dramaticilly dashboard loading
time, on my setup from 60 seconds to under 10 seconds.

Revision 8b65aac5 (diff)
Added by Ohad Levy about 4 years ago

Fixes #16238 - Speed up dashboard loading time.

I've change report host to inner query and used a join, in
my testing, this speed up dramaticilly dashboard loading
time, on my setup from 60 seconds to under 10 seconds.

(cherry picked from commit 95fd95eaf0df8756b049dcaf993b4d9709d86401)

History

#1 Updated by Ohad Levy over 4 years ago

just changing the query to inner query, saved about 70% of the load time, yet its far from being optimal.

    @latest_events ||= ConfigReport.authorized(:view_config_reports).my_reports.interesting.where(:host => hosts.reorder('')).search_for('reported > "7 days ago"').limit(9).includes(:host)

#2 Updated by Ohad Levy over 4 years ago

  • Related to Bug #16044: Errors in individual dashboard widgets fail entire page added

#3 Updated by The Foreman Bot over 4 years ago

  • Status changed from New to Ready For Testing
  • Assignee set to Ohad Levy
  • Pull request https://github.com/theforeman/foreman/pull/3764 added

#4 Updated by Ohad Levy over 4 years ago

  • Status changed from Ready For Testing to Closed
  • % Done changed from 0 to 100

#5 Updated by Dominic Cleal over 4 years ago

  • Legacy Backlogs Release (now unused) set to 181

#6 Updated by Dominic Cleal about 4 years ago

  • Related to Bug #16627: Puppet general tab new error on 1.12.3 added

#7 Updated by Dominic Cleal about 4 years ago

  • Related to Bug #16704: Searching fails on dashboard added

#8 Updated by Dominic Cleal about 4 years ago

Release set to 1.12.3

Reverted again in 1.12.4 due to too many regressions, and the severe impact of errors on the dashboard. The change remains in 1.13.0 at this time as the errors (e.g. #16704) are more limited.

#9 Updated by Ohad Levy over 3 years ago

  • Related to Bug #18893: dashboard widget for puppet report latest events can be very slow on large amount of reports added

Also available in: Atom PDF