Bug #16238
closed
dashboard widget for latests events can be exteramlly slow
Added by Ohad Levy over 8 years ago.
Updated over 6 years ago.
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
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)
- Related to Bug #16044: Errors in individual dashboard widgets fail entire page added
- Status changed from New to Ready For Testing
- Assignee set to Ohad Levy
- Pull request https://github.com/theforeman/foreman/pull/3764 added
- Status changed from Ready For Testing to Closed
- % Done changed from 0 to 100
- Translation missing: en.field_release set to 181
- Related to Bug #16627: Puppet general tab new error on 1.12.3 added
- Related to Bug #16704: Searching fails on dashboard added
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.
- 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