Skip to content

Instantly share code, notes, and snippets.

@patrick0057
Last active November 1, 2019 05:16
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save patrick0057/6bd333211dd8b6c408ed2f27783d4795 to your computer and use it in GitHub Desktop.
Save patrick0057/6bd333211dd8b6c408ed2f27783d4795 to your computer and use it in GitHub Desktop.
Why is my requested memory unit now set to 'm' and what does it mean?

Below I'm archiving a slightly modified quote from Alena Prokharchyk in this Gist as it contains useful information that I would like to reference later.

Memory resources in Kubernetes are mesured in bytes, and can be expressed as an integer with one of these suffixes: E, P, T, G, M, K - decimal suffixes, or Ei, Pi, Ti, Gi, Mi, Ki - binary > suffixes (more commonly used for memory), or omit the suffix altogether (https://kubernetes.io/docs/concepts/configuration/manage-compute-resources-container/#meaning-of-memory). Lowercase "m" > is not a recommended suffix for memory.

Cluster.requested.memory is comprised of corresponding node.requested.memory. node.requested.memory is the sum of requested.memory of all the pods scheduled on this node.

While most of the nodes have memory with binary suffixes - memory": "2630Mi", two of them have a suffix "m":

node1.acme.com = 3731881984500m

node2.acme.com = 2757754880500m

These 2 hosts' suffixes result in incorrect unit on the cluster. Once the nodes having this unit, are corrected, the memory on the cluster should be set to the value having the right unit.

To correct node.requested.memory, you should go over all the pods scheduled on these nodes and check if any of them have requested.memory prefix set to "m" and correct it to be a binary suffix > Mi/Ki. "m" is a milli value. If during the addition one of the pods has "m" with the low value, the sum will match its precision.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment