Bug 1215285 - Requiring less gem added 500mb to worker VIRT memory
Summary: Requiring less gem added 500mb to worker VIRT memory
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat CloudForms Management Engine
Classification: Red Hat
Component: Appliance
Version: 5.4.0
Hardware: Unspecified
OS: Unspecified
unspecified
high
Target Milestone: GA
: 5.4.0
Assignee: Joe Rafaniello
QA Contact: Milan Falešník
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2015-04-24 22:27 UTC by Dave Johnson
Modified: 2015-06-16 13:00 UTC (History)
5 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2015-06-16 13:00:13 UTC
Category: ---
Cloudforms Team: ---
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2015:1100 0 normal SHIPPED_LIVE CFME 5.4.0 bug fixes, and enhancement update 2015-06-16 16:28:42 UTC

Description Dave Johnson 2015-04-24 22:27:59 UTC
Description of problem:
===================================
I noticed VIRT memory on worker processes is much larger than it was on 5.3.z appliances.  I spoke to LJ about it who tracked it down to the addition of the less gem


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


How reproducible:
=====================================
100%


Steps to Reproduce:
===================================
1.  run an appliance
2.  run 'top'
3.  compare results with a 5.3 appliance.


Actual results:
=============================

some 5.4 appliance worker processes (VIRT is column 5)
---------------------------------------
 4615 root      20   0  993m 174m 3172 R  8.0  3.0 141:19.38 ruby                                                                                                                      
25842 root      23   3  990m 270m 9392 S  0.0  4.6  20:35.25 ruby                                                                                                                      
some 5.3 appliance worker processes (VIRT is column 5)
---------------------------------------
 4951 root      23   3  499m 332m 6888 S  0.0  5.7 170:58.94 ruby                                                                                                                      
 4651 root      20   0  432m 206m 6284 S  1.6  3.5 167:44.15 ruby

Comment 3 Joe Rafaniello 2015-04-27 18:30:21 UTC
Upstream pull request: https://github.com/ManageIQ/manageiq/pull/2758

Comment 4 CFME Bot 2015-04-28 15:01:15 UTC
New commit detected on manageiq/master:
https://github.com/ManageIQ/manageiq/commit/80b683f50c00ee2222d0c75c24a29424f1b69409

commit 80b683f50c00ee2222d0c75c24a29424f1b69409
Author:     Joe Rafaniello <jrafanie>
AuthorDate: Mon Apr 27 11:23:17 2015 -0400
Commit:     Joe Rafaniello <jrafanie>
CommitDate: Mon Apr 27 14:18:08 2015 -0400

    Don't eager require therubyracer/less-rails
    
    require 'less' by itself consumes 500+ MB of virtual memory per process.
    However, we only need less/less-rails to precompile less assets into css.
    In production mode, we should have all of the less assets precompiled so
    there's no need to take this 500 MB hit.
    
    https://bugzilla.redhat.com/show_bug.cgi?id=1215285

 vmdb/Gemfile | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

Comment 5 Joe Rafaniello 2015-04-28 15:39:21 UTC
Some more diagnostics: https://gist.github.com/jrafanie/a6d5066216ab89e54ece

Comment 7 Milan Falešník 2015-05-07 08:53:06 UTC
Verified in 5.4.0.0.25.

After putting evmserverd to stop, patching the lib/util/require_with_logging.rb with memory output printing, I ran the command as mentioned in the gist and there was no memory jump after including sprockets/less, which is the only mention about less I could find in the report. No mention of v8 too.

I also checked the memory usage in htop, the highest virtual memory consumption of any EVM process was ~415M.

Comment 9 errata-xmlrpc 2015-06-16 13:00:13 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://rhn.redhat.com/errata/RHBA-2015-1100.html


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