Project

General

Profile

Actions

Bug #7259

closed

Rendering hosts/show.html.erb very slow (40s)

Added by Arnd Hannemann over 9 years ago. Updated over 9 years ago.

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

Description

Hi,

we are using foreman 1.5.2 on debian wheezy and a puppet interval of 5 Minutes,
so we get quiet a view reports.

When viewing a host via https://foreman.../hosts/node
foreman is burning CPU and it takes around 40 Seconds for the default range of
7 Days.

The Logfile shows something like that:
Started GET "/hosts/....?range=7" for ...
Processing by HostsController#show as HTML
Parameters: {"range"=>"7", "id" => "node5"}
Rendered hosts/_overview.html.erb (33.0ms)
Rendered hosts/_metrics.html.erb (0.2ms)
Rendered hosts/show.html.erb within layouts/application (40714.1ms)
...
Completed 200 OK in 41113.9 ms (Views: 40673.2ms | ActiveRecord: 86.6ms)

For above timing example there are "1978" reports found. However, I think
there is something wrong, if it takes this longs on a reasonable fast
machine to display. As said, while viewing this page, the foreman/Rack
process handling this request is burning 100% cpu, so the database seems
out of the question here.


Related issues 1 (0 open1 closed)

Is duplicate of Foreman - Refactor #2232: Can we speed up loading of Host overview page.ClosedTomer Brisker02/20/2013Actions
Actions #1

Updated by Dominic Cleal over 9 years ago

  • Category set to Performance
Actions #2

Updated by Frank Wall over 9 years ago

I can confirm this issue. It's the same here running two instances of foreman (1.5.1 and 1.5.2) and the page loads slow for all "older" hosts (i.e. the ones with many reports).

Actions #3

Updated by Elodie B over 9 years ago

Same problem here with foreman 1.6.2. It is not very very slow but I have to wait at least 11s.

Processing by HostsController#show as HTML
Parameters: {"id"=>"hostname.domain"}
Rendered hosts/_overview.html.erb (9.6ms)
Rendered hosts/show.html.erb within layouts/application (11962.8ms)
Rendered home/_user_dropdown.html.erb (1.7ms)
Read fragment views/tabs_and_title_records-2 0.1ms
Rendered home/_topbar.html.erb (3.4ms)
Rendered layouts/base.html.erb (116.9ms)
Completed 200 OK in 12120.9ms (Views: 12071.6ms | ActiveRecord: 14.0ms)

Is there something we can do in our server to reduce this time ?

Actions #4

Updated by Ohad Levy over 9 years ago

  • Is duplicate of Refactor #2232: Can we speed up loading of Host overview page. added
Actions #5

Updated by Ohad Levy over 9 years ago

  • Status changed from New to Duplicate

this is fixed as part of 1.7, would be great if you can give 1.7RC1 a try.. thanks!

Actions #6

Updated by Andre Timmermann over 9 years ago

If someone can't update to 1.7 right now, deleting reports might be a workaround.

http://theforeman.org/manuals/1.6/index.html#3.5.4PuppetReports

Expire reports automatically

You will probably want to delete your reports after some time to limit database growth. To do so, you can set a cronjob:

Available conditions:

days => number of days to keep reports (defaults to 7)
status => status of the report (defaults to 0 --> "reports with no errors")
Example:

Expires all reports regardless of their status
foreman-rake reports:expire days=7
expires all non interesting reports after one day
foreman-rake reports:expire days=1 status=0

Without the reports the node-page takes 319.7ms instead of 22215.3ms

Actions

Also available in: Atom PDF