Bug 1369589 - [RFE] Add vm.overcommit_memory check
Summary: [RFE] Add vm.overcommit_memory check
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Satellite
Classification: Red Hat
Component: Installer
Version: 6.1.9
Hardware: x86_64
OS: Linux
low
low
Target Milestone: Unspecified
Assignee: Chris Roberts
QA Contact: Daniel Lobato Garcia
URL: http://projects.theforeman.org/issues...
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2016-08-23 21:03 UTC by Josh Foots
Modified: 2019-11-14 08:59 UTC (History)
7 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2018-02-21 16:54:17 UTC
Target Upstream Version:


Attachments (Terms of Use)


Links
System ID Priority Status Summary Last Updated
Foreman Issue Tracker 16300 None None None 2016-08-25 16:55:01 UTC

Description Josh Foots 2016-08-23 21:03:11 UTC
Description of problem:

There should be a check to ensure that the vm.overcommit_memory variable is set to 0 on Red Hat Satellite 6.X

We have two scripts to add this check into:

One is : https://access.redhat.com/solutions/1474003

The other is the pre-upgrade check preformed by the foreman-installer itself:

# foreman-rake katello:upgrade_check

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


How reproducible:

Very

Steps to Reproduce:
1. Set teh vm.overcommit to 2 and the upgrade will fail every time.
2.
3.

Actual results:

Currently there is no check for this.

Expected results:

For either the healthcheck script or the preupgrade script to flag this as needing to be fixed.



Additional info:

This BZ is related to https://access.redhat.com/solutions/2548501

Comment 1 Chris Duryee 2016-08-24 14:23:07 UTC
add'l info:

If you run a java app without Xmx set, it will ask for 1/4 of physical memory. If vm.overcommit_memory is set to 0 (default) or 1, this  is fine. The OS will give the process 1/4 of memory, but will not guarantee that the full space is available. However, if vm.overcommit_memory is set to 2, it enforces that all memory allocated to processes is backed by physical memory.

To try this out, you can start a VM, use >75% of memory, then run "java -version". If overcommit is set to 2, it will fail. This is not unreasonable behavior, since Java has no idea how much mem it will need without Xmx guidance, and typically it's fine to ask for more than what it actually uses.

Some users set vm.overcommit_memory to 2 in order to avoid OOM conditions. However, any process that asks for more memory than it needs may not be able to execute.

There are two ways to "fix" this for Satellite:

 * verify that overcommit is not set to 2 during pre-upgrade check
 * ensure that all java processes have Xmx set to something reasonable, to avoid the "25% of physical mem" default.

Both of these would be good to do, but the first option is most needed. Users should not run overcommit_memory=2 on a Satellite, since it is not a tested scenario.

Comment 2 Stephen Benjamin 2016-08-25 16:54:59 UTC
Created redmine issue http://projects.theforeman.org/issues/16300 from this bug

Comment 6 Daniel Lobato Garcia 2017-08-30 13:49:12 UTC
Verified.

Tested in Satellite 6.3 - Snap 13


Some output from the CLI of what I did to verify:
---

[root@tyan-gt24-13 ~]# sysctl -n vm.overcommit_memory
2
[root@tyan-gt24-13 ~]# satellite-installer
This system has the vm.overcommit.memory flag enabled in sysctl. Please set this to 0 and then run the installer again.

Comment 7 pm-sat@redhat.com 2018-02-21 16:54:17 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/RHSA-2018:0336


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