Project

General

Profile

Actions

Bug #18893

closed

dashboard widget for puppet report latest events can be very slow on large amount of reports

Added by Ohad Levy about 7 years ago. Updated almost 6 years ago.

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

Description

I have about 3M reports, and I see

16:02:11 rails.1   | 2017-03-14T16:02:11 843d16a1 [app] [I] Started GET "/widgets/19" for ::1 at 2017-03-14 16:02:11 +0200
16:02:11 rails.1   | 2017-03-14T16:02:11 843d16a1 [app] [I] Processing by DashboardController#show as HTML
16:02:11 rails.1   | 2017-03-14T16:02:11 843d16a1 [app] [I]   Parameters: {"id"=>"19"}
16:02:11 rails.1   | 2017-03-14T16:02:11 843d16a1 [sql] [D]   ActiveRecord::SessionStore::Session Load (0.2ms)  SELECT  "sessions".* FROM "sessions" WHERE "sessions"."session_id" = $1  ORDER BY "sessions"."id" ASC LIMIT 1  [["session_id", "843d16a1d11fc12baad1b8281e4926d2"]]
16:02:11 rails.1   | 2017-03-14T16:02:11 843d16a1 [sql] [D]   User Load (0.3ms)  SELECT  "users".* FROM "users" WHERE "users"."id" = $1 LIMIT 1  [["id", 1]]
16:02:11 rails.1   | 2017-03-14T16:02:11 843d16a1 [app] [D] Setting current user thread-local variable to admin
16:02:11 rails.1   | 2017-03-14T16:02:11 843d16a1 [sql] [D]    (0.3ms)  SELECT COUNT(*) FROM "taxonomies" WHERE "taxonomies"."type" IN ('Organization')
16:02:11 rails.1   | 2017-03-14T16:02:11 843d16a1 [app] [D] Setting current organization thread-local variable to none
16:02:11 rails.1   | 2017-03-14T16:02:11 843d16a1 [sql] [D]    (0.3ms)  SELECT COUNT(*) FROM "taxonomies" WHERE "taxonomies"."type" IN ('Location')
16:02:11 rails.1   | 2017-03-14T16:02:11 843d16a1 [app] [D] Setting current location thread-local variable to none
16:02:11 rails.1   | 2017-03-14T16:02:11 843d16a1 [sql] [D]   AuthSource Load (0.2ms)  SELECT  "auth_sources".* FROM "auth_sources" WHERE "auth_sources"."id" = $1 LIMIT 1  [["id", 1]]
16:02:11 rails.1   | 2017-03-14T16:02:11 843d16a1 [sql] [D]    (0.7ms)  SELECT  "taxonomies"."id" FROM "taxonomies" WHERE "taxonomies"."type" IN ('Location') LIMIT 1
16:02:11 rails.1   | 2017-03-14T16:02:11 843d16a1 [sql] [D]    (0.3ms)  SELECT  "taxonomies"."id" FROM "taxonomies" WHERE "taxonomies"."type" IN ('Organization') LIMIT 1
16:02:11 rails.1   | 2017-03-14T16:02:11 843d16a1 [sql] [D]    (0.4ms)  SELECT COUNT(*) FROM "widgets" 
16:02:11 rails.1   | 2017-03-14T16:02:11 843d16a1 [sql] [D]   Widget Load (0.4ms)  SELECT  "widgets".* FROM "widgets" WHERE "widgets"."id" = $1 LIMIT 1  [["id", 19]]
16:02:11 rails.1   | 2017-03-14T16:02:11 843d16a1 [sql] [D]   User Load (0.3ms)  SELECT  "users".* FROM "users" WHERE "users"."id" = $1  ORDER BY firstname LIMIT 1  [["id", 1]]
16:04:21 rails.1   | 2017-03-14T16:04:21 843d16a1 [sql] [D]   ConfigReport Exists (129783.2ms)  SELECT  1 AS one FROM "reports" WHERE "reports"."type" IN ('ConfigReport') AND (status <> 0) AND ("reports"."host_id" IN (SELECT "hosts"."id" FROM "hosts" WHERE "hosts"."type" IN ('Host::Managed'))) AND (("reports"."reported_at" >= '2017-03-08')) LIMIT 1
16:04:21 rails.1   | 2017-03-14T16:04:21 843d16a1 [app] [I]   Rendered dashboard/_reports_widget.html.erb (129789.7ms)
16:04:21 rails.1   | 2017-03-14T16:04:21 843d16a1 [app] [I] Completed 200 OK in 129811ms (Views: 10.1ms | ActiveRecord: 129786.7ms)
16:04:21 rails.1   | 2017-03-14T16:04:21 843d16a1 [sql] [D]    (4.2ms)  BEGIN
16:04:21 rails.1   | 2017-03-14T16:04:21 843d16a1 [sql] [D]    (0.2ms)  COMMIT

I believe this happens because we join the reports and hosts table where I'm uncertain its required.


Related issues 1 (0 open1 closed)

Related to Foreman - Bug #16238: dashboard widget for latests events can be exteramlly slowClosedOhad Levy08/23/2016Actions
Actions #1

Updated by Ohad Levy about 7 years ago

  • Related to Bug #16238: dashboard widget for latests events can be exteramlly slow added
Actions #2

Updated by The Foreman Bot about 7 years ago

  • Status changed from New to Ready For Testing
  • Assignee set to Tomer Brisker
  • Pull request https://github.com/theforeman/foreman/pull/4374 added
Actions #3

Updated by Anonymous about 7 years ago

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

Updated by Ohad Levy about 7 years ago

  • translation missing: en.field_release set to 209
Actions

Also available in: Atom PDF