Bug #1817

Rendering edit templates takes a very long time

Added by Nacho Barrientos 10 months ago. Updated 5 months ago.

Status:New Start:08/09/2012
Priority:Normal Due date:
Assigned to:- % Done:

0%

Category:-
Target version:-
Backlog:No Difficulity:
Votes: 0

Description

Hi,

We've been experiencing very long response times using the UI to edit some entities, mainly hosts and hostgroups.

After some investigation, we found out that in some cases some edit operations were taking even longer than 20 seconds.

Average time in ms calculated from the log files:

[root@foreman01 foreman]# zcat .gz | egrep "Rendered.+edit" | sed -e "s/[^)](\([0-9.]*\)ms)/\1/" | awk '{s+=$1} END {print s/NR}'

5805.36

Attached is a full log entry for one edit operation that took 12818ms.

We're running Foreman 1.0.0 installed from RPMs taken from yum.theforeman.org/development/el6/x86_64.

Follow up if you need more debug data or information about any particular configuration detail.

production.log (368.7 KB) Nacho Barrientos, 08/09/2012 10:02 am

History

Updated by Ohad Levy 9 months ago

it seems like rendering the page took most of the time (vs. sql), I'll try to see if we can cache some of the html (e.g. maybe things like classes selection etc) thanks for reporting!

Updated by Daniel Lobato Garcia 5 months ago

Been looking into it for a while, it looks to me that the templates that are causing the greatest delays are usually:

edit
_form
_list
_filters
index
show

for:

hostgroups
users
operating systems
hosts

Some of these can be greatly improved with gem multi_fetch_fragments(1). As for the ones that don't require rendering collections of elements, I don't know how to improve these. Any insights?

1: http://ninjasandrobots.com/rails-faster-partial-rendering-and-caching/

Also available in: Atom PDF