Bug 1281999 - Long rendering times causing slow UI performance
Long rendering times causing slow UI performance
Status: CLOSED ERRATA
Product: Red Hat CloudForms Management Engine
Classification: Red Hat
Component: Performance (Show other bugs)
5.4.0
Unspecified Unspecified
high Severity high
: GA
: 5.6.0
Assigned To: Keenan Brock
Alex Krzos
ui:perf
: ZStream
: 1302148 (view as bug list)
Depends On:
Blocks: 1289195 1289196
  Show dependency treegraph
 
Reported: 2015-11-13 22:13 EST by Jared Deubel
Modified: 2017-07-14 10:47 EDT (History)
14 users (show)

See Also:
Fixed In Version: 5.6.0.0
Doc Type: Bug Fix
Doc Text:
Previously, there were performance issues in the CloudForms user interface when going to Infrastructure > Virtual Machines. The tab seeing times was upwards of 40+ seconds consistently. This patch removes unused parameter targets from MiqSearch#search and simplifies the pattern of searching or using an existing filter which has now resolved the issue.
Story Points: ---
Clone Of:
: 1289195 1289196 (view as bug list)
Environment:
Last Closed: 2016-06-29 11:07:43 EDT
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Jared Deubel 2015-11-13 22:13:33 EST
Created attachment 1093974 [details]
snippet_infra

Description of problem:

Performance issues in the UI, when going to Infrastructure/Virtual Machines tab seeing times upwards of 40+ seconds consistently. This is happening with admin and non-admin users. Also, there doesn't seem to be any caching issues since this can happen after logging back in. 

Snippet from production.log showing the loading of the Infra/Virtual Machines taking 53 seconds. Some of the renderings are taking 4+ seconds to such as calls as loading global_footer and/or adv_search. 
============================================
[----] I, [2015-11-13T17:36:23.166686 #7085:cb5e94]  INFO -- :   Rendered layouts/exp_atom/_editor.html.haml (4336.8ms)
[----] I, [2015-11-13T17:36:23.167033 #7085:cb5e94]  INFO -- :   Rendered layouts/_exp_editor.html.haml (4346.4ms)
[----] I, [2015-11-13T17:36:23.167232 #7085:cb5e94]  INFO -- :   Rendered layouts/_adv_search_body.html.haml (4350.9ms)
[----] I, [2015-11-13T17:36:23.170490 #7085:cb5e94]  INFO -- :   Rendered layouts/_adv_search_footer.html.haml (2.9ms)
[----] I, [2015-11-13T17:36:23.170701 #7085:cb5e94]  INFO -- :   Rendered layouts/_adv_search.html.haml (4359.8ms)
[----] I, [2015-11-13T17:36:23.170966 #7085:cb5e94]  INFO -- :   Rendered layouts/_global_footer.html.haml (4360.4ms)
[----] I, [2015-11-13T17:36:23.181772 #7085:cb5e94]  INFO -- : Completed 200 OK in 52750.7ms (Views: 5493.7ms | ActiveRecord: 2177.6ms)
============================================

Did some high level viewing of the DB and this seems to be running properly (not seeing any bloat, or fragmented indecies that would cause long running query times). It seems from the one snippet above that the query comes back after 2 seconds to which there is a lot of unaccounted time rendering. 


Version-Release number of selected component (if applicable):
5.4.2.0

How reproducible:


Steps to Reproduce:
1. Navigate to Infrastructure-> Virtual Machines
2. Screen sits there loading for 50+ seconds


Actual results:


Expected results:


Additional info:
Comment 2 dmetzger 2015-11-18 11:16:04 EST
Can we get a full evm.log and configuration from this appliance to review?
Comment 14 Keenan Brock 2015-12-01 10:26:22 EST
@paldeala

Yes, I'm seeing significant time spent on the main content, the security filtering, and the (left hand) side component.

I'm currently making modifications seeing how I can reduce the number of queries, which will reduce the database load, web server cpu and memory requirements.

I'm currently targeting 5.6 of the product. After I get a solution, I will assess the risk for port to 5.5 and 5.4.

Thank you for all your help,
Keenan
Comment 16 CFME Bot 2016-01-04 14:51:07 EST
New commit detected on ManageIQ/manageiq/master:
https://github.com/ManageIQ/manageiq/commit/aaaf2544e3862161f8972ee07d4068801ceeb2b2

commit aaaf2544e3862161f8972ee07d4068801ceeb2b2
Author:     Keenan Brock <kbrock@redhat.com>
AuthorDate: Thu Dec 3 23:18:44 2015 -0500
Commit:     Keenan Brock <kbrock@redhat.com>
CommitDate: Wed Dec 23 15:18:59 2015 -0500

    Merge common use of MiqSearch and Rbac filtered
    
    - remove unused parameter targets from MiqSearch#search
    
    simplify the pattern of searching or using an existing filter
    
    https://bugzilla.redhat.com/show_bug.cgi?id=1281999

 app/models/miq_provision_virt_workflow.rb | 16 ++----
 app/models/miq_request_workflow.rb        | 14 ++----
 app/models/miq_search.rb                  | 20 +++++++-
 spec/models/miq_search_spec.rb            | 83 +++++++++++++++++++++++++++++++
 4 files changed, 109 insertions(+), 24 deletions(-)
Comment 18 dmetzger 2016-01-28 10:31:08 EST
*** Bug 1302148 has been marked as a duplicate of this bug. ***
Comment 24 CFME Bot 2016-02-03 10:15:53 EST
New commit detected on ManageIQ/manageiq/master:
https://github.com/ManageIQ/manageiq/commit/73e121ec1ddcce6028f9add171c956d234a3e2e4

commit 73e121ec1ddcce6028f9add171c956d234a3e2e4
Author:     Jason Frey <jfrey@redhat.com>
AuthorDate: Tue Feb 2 21:47:48 2016 -0500
Commit:     Jason Frey <jfrey@redhat.com>
CommitDate: Tue Feb 2 22:29:56 2016 -0500

    Simplify archived? and orphaned? to not use associations
    
    In doing so, the TreeBuilderVmsAndTemplates no longer needs
    to preload the EMS.
    
    https://bugzilla.redhat.com/show_bug.cgi?id=1281999

 app/models/vm_or_template.rb                     | 8 ++++----
 app/presenters/tree_builder_vms_and_templates.rb | 9 ---------
 spec/models/miq_provision_workflow_spec.rb       | 3 ++-
 3 files changed, 6 insertions(+), 14 deletions(-)
Comment 27 CFME Bot 2016-02-04 16:51:09 EST
New commit detected on ManageIQ/manageiq/master:
https://github.com/ManageIQ/manageiq/commit/edadc56e97c7e9406a7b9bfca3becab432ee48a5

commit edadc56e97c7e9406a7b9bfca3becab432ee48a5
Author:     Keenan Brock <kbrock@redhat.com>
AuthorDate: Thu Feb 4 10:46:57 2016 -0500
Commit:     Keenan Brock <kbrock@redhat.com>
CommitDate: Thu Feb 4 11:41:26 2016 -0500

    Improve sort performance in Rbac#search
    
    https://bugzilla.redhat.com/show_bug.cgi?id=1281999

 app/models/rbac.rb                                   | 2 +-
 spec/controllers/provider_foreman_controller_spec.rb | 5 +++++
 2 files changed, 6 insertions(+), 1 deletion(-)
Comment 28 CFME Bot 2016-02-09 16:52:50 EST
New commit detected on cfme/5.4.z:
https://code.engineering.redhat.com/gerrit/gitweb?p=cfme.git;a=commitdiff;h=1b4cd8dd998a0339bbce4f7e928b96b94be6e928

commit 1b4cd8dd998a0339bbce4f7e928b96b94be6e928
Author:     Keenan Brock <kbrock@redhat.com>
AuthorDate: Tue Feb 2 14:25:01 2016 -0500
Commit:     Keenan Brock <kbrock@redhat.com>
CommitDate: Thu Feb 4 13:04:35 2016 -0500

    Improve sort performance in Rbac#search
    
    https://bugzilla.redhat.com/show_bug.cgi?id=1281999

 vmdb/app/models/rbac.rb | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
Comment 29 CFME Bot 2016-02-09 16:52:56 EST
New commit detected on cfme/5.4.z:
https://code.engineering.redhat.com/gerrit/gitweb?p=cfme.git;a=commitdiff;h=40a99c451e11c26df5e53b74ad619b9979e41abd

commit 40a99c451e11c26df5e53b74ad619b9979e41abd
Merge: 1b9d245 1b4cd8d
Author:     Joe Rafaniello <jrafanie@redhat.com>
AuthorDate: Tue Feb 9 16:25:10 2016 -0500
Commit:     Joe Rafaniello <jrafanie@redhat.com>
CommitDate: Tue Feb 9 16:25:10 2016 -0500

    Merge branch 'patched_sorting' into '5.4.z'
    
    Improve sort performance in Rbac#search
    
    Based upon [#6495](https://github.com/ManageIQ/manageiq/pull/6495)
    
    Manually applied changes
    
    This addresses
    https://bugzilla.redhat.com/show_bug.cgi?id=1281999
    
    5.4.5 BZ: https://bugzilla.redhat.com/show_bug.cgi?id=1289196
    
    See merge request !769

 vmdb/app/models/rbac.rb | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
Comment 31 CFME Bot 2016-02-16 15:14:32 EST
New commit detected on cfme/5.4.z:
https://code.engineering.redhat.com/gerrit/gitweb?p=cfme.git;a=commitdiff;h=7b780a15f2fd4573b51d8835ab6f39b28a4f8d6c

commit 7b780a15f2fd4573b51d8835ab6f39b28a4f8d6c
Author:     Jason Frey <jfrey@redhat.com>
AuthorDate: Tue Feb 2 21:47:48 2016 -0500
Commit:     Keenan Brock <kbrock@redhat.com>
CommitDate: Fri Feb 12 14:52:54 2016 -0500

    Simplify archived? and orphaned? to not use associations
    
    In doing so, the TreeBuilderVmsAndTemplates no longer needs
    to preload the EMS.
    
    https://bugzilla.redhat.com/show_bug.cgi?id=1281999
    
    taken from #6487

 vmdb/app/models/vm_or_template.rb                  |  8 ++++----
 .../presenters/tree_builder_vms_and_templates.rb   |  9 ---------
 vmdb/spec/models/miq_provision_workflow_spec.rb    | 23 ++++++++++++++++++++++
 3 files changed, 27 insertions(+), 13 deletions(-)
Comment 32 CFME Bot 2016-02-16 15:14:38 EST
New commit detected on cfme/5.4.z:
https://code.engineering.redhat.com/gerrit/gitweb?p=cfme.git;a=commitdiff;h=26e38bcb5a3c52f81f31974defdf855746fad7c7

commit 26e38bcb5a3c52f81f31974defdf855746fad7c7
Merge: b01191e 7b780a1
Author:     Oleg Barenboim <obarenbo@redhat.com>
AuthorDate: Tue Feb 16 14:49:32 2016 -0500
Commit:     Oleg Barenboim <obarenbo@redhat.com>
CommitDate: Tue Feb 16 14:49:32 2016 -0500

    Merge branch 'bz_1281999_mr_orphans_54z' into '5.4.z'
    
    Simplify archived? and orphaned? to not use associations
    
    In doing so, the TreeBuilderVmsAndTemplates no longer needs
    to preload the EMS.
    
    https://bugzilla.redhat.com/show_bug.cgi?id=1281999
    
    5.4.5 BZ: https://bugzilla.redhat.com/show_bug.cgi?id=1289196
    
    taken from #6487 (semi clean cherry-pick)
    
    See merge request !770

 vmdb/app/models/vm_or_template.rb                  |  8 ++++----
 .../presenters/tree_builder_vms_and_templates.rb   |  9 ---------
 vmdb/spec/models/miq_provision_workflow_spec.rb    | 23 ++++++++++++++++++++++
 3 files changed, 27 insertions(+), 13 deletions(-)
Comment 34 Keenan Brock 2016-06-02 10:05:05 EDT
Service patches were applied to 5.6 and patch provided for 5.4.
Comment 36 errata-xmlrpc 2016-06-29 11:07:43 EDT
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHBA-2016:1348

Note You need to log in before you can comment on or make changes to this bug.