Bug 1818758 - memory.memsw.limit_in_bytes value does not reflect the limits set in the Deployment Config
Summary: memory.memsw.limit_in_bytes value does not reflect the limits set in the Depl...
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: OpenShift Container Platform
Classification: Red Hat
Component: Node
Version: 4.3.0
Hardware: Unspecified
OS: Unspecified
unspecified
medium
Target Milestone: ---
: 4.5.0
Assignee: Peter Hunt
QA Contact: Sunil Choudhary
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2020-03-30 09:47 UTC by mchebbi@redhat.com
Modified: 2020-07-13 17:24 UTC (History)
5 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2020-07-13 17:24:11 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Github cri-o cri-o pull 3349 0 None closed SetLinuxResourcesMemorySwap to the LinuxResourcesMemoryLimit 2020-06-23 09:40:35 UTC
Github cri-o cri-o pull 3564 0 None closed SetLinuxResourcesMemorySwap to the LinuxResourcesMemoryLimit 2020-06-23 09:40:35 UTC
Red Hat Product Errata RHBA-2020:2409 0 None None None 2020-07-13 17:24:33 UTC

Description mchebbi@redhat.com 2020-03-30 09:47:27 UTC
the customer has a process wrapper read the values from:  /sys/fs/cgroup/memory/memory.limit_in_bytes, /sys/fs/cgroup/memory/memory.memsw.limit_in_bytes and calculates Xms and Xmx based on the highest value of those two and JAVA_MAX_MEM_RATIO.

It Works on opc 3.11 but in 4.3 the memory.memsw.limit_in_bytes value does not reflect the limits set in the Deployment Config.
==============================================================
extraction from the deployment config for the pod:

$ oc get dc test-sunny -oyaml | yq .spec.template.spec.containers[0].resources
{
  "limits": {
    "cpu": "1",
    "memory": "1Gi"
  },
  "requests": {
    "cpu": "500m",
    "memory": "512Mi"
  }
==============================================================


oc get dc test-sunny -oyaml | yq .spec.template.spec.containers[0].env
[
  {
    "name": "POD_NAME",
    "valueFrom": {
      "fieldRef": {
        "apiVersion": "v1",
        "fieldPath": "metadata.name"
      }
    }
  },
  {
    "name": "POD_NAMESPACE",
    "valueFrom": {
      "fieldRef": {
        "apiVersion": "v1",
        "fieldPath": "metadata.namespace"
      }
    }
  },
  {
    "name": "JAVA_MAX_MEM_RATIO",
    "value": "40"
  }
]

==============================================================
case ID: 02616909

Comment 2 Peter Hunt 2020-03-30 19:20:57 UTC
I am setting up a PR built on top of the attached PR that will implement this in master. Once that's done, I'll backport it to get it into 4.3

Comment 4 Peter Hunt 2020-05-12 19:30:49 UTC
a PR to fix this has merged into 4.5. I am currently in the process of backporting to 4.4 and 4.3

Comment 9 errata-xmlrpc 2020-07-13 17:24:11 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-2020:2409


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