Bug 1337967

Summary: Performance difference in field sends from 5.5 -> 5.6
Product: Red Hat CloudForms Management Engine Reporter: Pete Savage <psavage>
Component: PerformanceAssignee: Jason Frey <jfrey>
Status: CLOSED ERRATA QA Contact: Pete Savage <psavage>
Severity: high Docs Contact:
Priority: high    
Version: 5.6.0CC: cpelland, dmetzger, hkataria, jhardy, mfeifer, mpovolny, obarenbo, simaishi
Target Milestone: GA   
Target Release: 5.6.0   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard: ui
Fixed In Version: 5.6.0.11 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2016-06-29 16:04:48 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Pete Savage 2016-05-20 14:58:29 UTC
Description of problem:

Posting the data from a field to the server is 3-4 times slower in 5.6 than in 5.5 this was 76ms on 5.5 -> 278ms(319ms worst) on 5.6.

This is in a highly controlled environment both appliances on the same hardware with more than enough room on it......the ping to the provider is 0.7ms (it's right next to me, so negligible)

The problem is when I'm accessing a CFME appliance in the US from the EU(which could be a typical use case) my 250ms network latency increases to over 500ms with this additional delay.

This makes it very possible to fill in a form, and click to another tab, before the send/return is complete and the upshot of that is that CFME forgets the data from one tab to the next, meaning when I submit, it tells me I didn't fill in form properly, when I did.

Comparison of the production.log render times

Completed 200 OK in 58ms (Views: 29.4ms | ActiveRecord: 3.6ms) - 5.5
Completed 200 OK in 235ms (Views: 162.6ms | ActiveRecord: 0.0ms) - 5.6


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


How reproducible: 100%


Steps to Reproduce:
1. Add a provider (rhos tested)
2. Clouds -> Instances -> LifeCycle -> Provision Instances
3. Select a Provider type and a template
3. Type in some characters into the Email field

Actual results: Long render times seen when sending the field data


Expected results: Render/response times should be closer to that seen on 5.5


Additional info:

Comment 6 CFME Bot 2016-05-27 15:05:57 UTC
New commit detected on ManageIQ/manageiq/master:
https://github.com/ManageIQ/manageiq/commit/82348d711d67b5cadb0a22459bb9a452fd20187c

commit 82348d711d67b5cadb0a22459bb9a452fd20187c
Author:     Keenan Brock <kbrock>
AuthorDate: Thu May 26 23:54:19 2016 -0400
Commit:     Keenan Brock <kbrock>
CommitDate: Thu May 26 23:56:46 2016 -0400

    Rbac: skip current_user.group lookup for default
    
    |     ms |  sql | sqlms |  sqlrows |`comments`
    |    ---:|  ---:|   ---:|      ---:| ---
    |  511.7 |   32 |  10.7 |       25 |`/vm_infra/prov_field_changed/new`
    |  445.6 |   25 |   7.4 |       25 |`/vm_infra/prov_field_changed/new`
    | 12% | 22% | 30% | - | -
    
    Reduces 1 query per rbac call for 95% use case
    
    In this example, removed 7 queries. Think in general, improvement
    should be less
    
    https://bugzilla.redhat.com/show_bug.cgi?id=1337967

 app/models/rbac.rb | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

Comment 8 CFME Bot 2016-05-27 23:30:58 UTC
New commit detected on ManageIQ/manageiq/master:
https://github.com/ManageIQ/manageiq/commit/396abec5031bd982b8423f942eb1f744218b100b

commit 396abec5031bd982b8423f942eb1f744218b100b
Author:     Keenan Brock <kbrock>
AuthorDate: Fri May 27 18:33:22 2016 -0400
Commit:     Keenan Brock <kbrock>
CommitDate: Fri May 27 18:33:22 2016 -0400

    Rbac: Don't lookup null users
    
    A few rbac calls use the current user and group instead
    of passing those values in.
    
    before:
    The code was looking up users and groups with a null id.
    
    after:
    It doesn't lookup up a null userid/groupid.
    It goes straight to defaulting to the current user and group
    
    https://bugzilla.redhat.com/show_bug.cgi?id=1337967

 app/models/rbac.rb | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

Comment 9 Keenan Brock 2016-05-28 02:47:31 UTC
directions to reproduce with vmware

1. add a vmware provider
2. go to list of vms
3. from toolbar select provision a VM
4. start typing

notice call to /vm_infra/pre_prov and /vm_infra/prov_field_changed/new

Comment 12 CFME Bot 2016-06-14 13:55:52 UTC
New commit detected on ManageIQ/manageiq/master:
https://github.com/ManageIQ/manageiq/commit/28c457799050ca4c684d5bcf83ef9a363bdffea4

commit 28c457799050ca4c684d5bcf83ef9a363bdffea4
Author:     Jason Frey <jfrey>
AuthorDate: Wed Jun 1 11:13:36 2016 -0400
Commit:     Jason Frey <jfrey>
CommitDate: Tue Jun 14 01:46:34 2016 -0400

    Avoid querying the database when asking for local config
    
    Fixes #9014
    https://bugzilla.redhat.com/show_bug.cgi?id=1337967

 app/models/miq_server/configuration_management.rb       | 6 +++++-
 spec/models/miq_server/configuration_management_spec.rb | 5 +++++
 spec/support/settings_helper.rb                         | 4 ++++
 3 files changed, 14 insertions(+), 1 deletion(-)

Comment 13 Oleg Barenboim 2016-06-14 13:58:30 UTC
PR https://github.com/ManageIQ/manageiq/pull/9085 has been merged and backported to Darga branch.

Comment 15 Pete Savage 2016-06-16 14:43:43 UTC
Verified in 5.6.0.11

Comment 18 errata-xmlrpc 2016-06-29 16:04:48 UTC
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