Skip to content

Calculate oom_score_adj in a CPU-agnostic way, taking in consideration Pod Priority too #78848

Open
@pracucci

Description

@pracucci

What would you like to be added:

I would like to start a conversation to understand if we may improve GetContainerOOMScoreAdjust to:

  1. Calculate the oom_score_adj in a CPU-agnosticy way
  2. Take in account Pod Priority too

Why is this needed:

Currently, the kubelet sets a oom_score_adj value for each container based on the Pod QoS:

  • Guaranteed: -998
  • BestEffort: 1000
  • Burstable: min(max(2, 1000 - (1000 * memoryRequestBytes) / machineMemoryCapacityBytes), 999)

The QoS class depends both on the CPU and memory requests/limits, which means the oom_score_adj also depends on the CPU resources and not just on the memory resources, while OOM score is a purely memory management thing. Moreover, oom_score_adj is also Pod priority agnostic (except that critical pods always get -998, regardless their QoS class) which can cause higher priority pods to get evicted before lower priority pods under node memory pressure.

Metadata

Metadata

Assignees

No one assigned

    Labels

    kind/featureCategorizes issue or PR as related to a new feature.lifecycle/staleDenotes an issue or PR has remained open with no activity and has become stale.needs-triageIndicates an issue or PR lacks a `triage/foo` label and requires one.priority/backlogHigher priority than priority/awaiting-more-evidence.sig/nodeCategorizes an issue or PR as relevant to SIG Node.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions