Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add memory qos strategy #101

Merged

Conversation

saintube
Copy link
Member

Signed-off-by: saintube saintube@foxmail.com

Ⅰ. Describe what this PR does

add Memory QoS strategy to enhance resource assurance for k8s pods.

  1. MinLimtPercent: allow pods to lock some memory cache from global reclaim.
  2. ThrottlingPercent: allow pods to throttle memory allocation before reaching the memory limit.
  3. WmarkRatio: allow pods to get memory reclaimed asynchronously before direct reclaim.
  4. WmarkMinAdj: allow a node to prioritize global reclaim and make less disruption for high-priority pods.

Some of the above abilities require a kernel of cloud kernel/ Open Anolis OS.

related work: kubernetes/enhancements#2571

Ⅱ. Does this pull request fix one issue?

fixes #55

Ⅲ. Describe how to verify it

  1. Enable feature-gate CgroupReconcile in Koordlet.
  2. Turn on MemoryQOS in configmap slo-controller-config.
  3. Try colocation.

e.g.

apiVersion: v1
data:
  resource-qos-config: |-
    {
      "clusterStrategy": {
        "lsClass": {
           "memoryQOS": {
             "enable": true
           }
         }
      }
    }
kind: ConfigMap
metadata:
  name: slo-controller-config
  namespace: koordinator-system

Ⅳ. Special notes for reviews

None

apis/slo/v1alpha1/nodeslo_types.go Outdated Show resolved Hide resolved
pkg/util/config.go Outdated Show resolved Hide resolved
@codecov-commenter
Copy link

codecov-commenter commented Apr 28, 2022

Codecov Report

Merging #101 (cbae9d2) into main (ccbad0c) will increase coverage by 3.13%.
The diff coverage is 70.71%.

❗ Current head cbae9d2 differs from pull request most recent head 24fb108. Consider uploading reports for the commit 24fb108 to get more accurate results

@@            Coverage Diff             @@
##             main     #101      +/-   ##
==========================================
+ Coverage   44.19%   47.32%   +3.13%     
==========================================
  Files          73       75       +2     
  Lines        5965     6658     +693     
==========================================
+ Hits         2636     3151     +515     
- Misses       3036     3192     +156     
- Partials      293      315      +22     
Flag Coverage Δ
unittests 47.32% <70.71%> (+3.13%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
pkg/koordlet/resmanager/config.go 58.33% <ø> (+4.48%) ⬆️
pkg/koordlet/resmanager/resmanager.go 2.75% <0.00%> (+0.02%) ⬆️
pkg/util/config.go 0.00% <0.00%> (ø)
pkg/util/container.go 25.00% <0.00%> (-1.82%) ⬇️
pkg/util/pod.go 10.44% <0.00%> (-0.58%) ⬇️
pkg/util/system/cgroup.go 70.00% <0.00%> (ø)
pkg/util/system/cgroup_resource.go 0.00% <ø> (ø)
pkg/slo-controller/nodeslo/nodeslo_controller.go 60.15% <42.85%> (-0.97%) ⬇️
pkg/koordlet/resmanager/types.go 57.57% <64.70%> (+16.03%) ⬆️
...kg/koordlet/resmanager/resource_update_executor.go 66.89% <80.82%> (+23.84%) ⬆️
... and 7 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update ccbad0c...24fb108. Read the comment docs.

apis/slo/v1alpha1/nodeslo_types.go Outdated Show resolved Hide resolved
apis/slo/v1alpha1/nodeslo_types.go Outdated Show resolved Hide resolved
apis/slo/v1alpha1/nodeslo_types.go Outdated Show resolved Hide resolved
pkg/features/koordlet_features.go Show resolved Hide resolved
pkg/slo-controller/nodeslo/nodeslo_controller.go Outdated Show resolved Hide resolved
pkg/util/pod.go Outdated Show resolved Hide resolved
pkg/util/pod.go Show resolved Hide resolved
Signed-off-by: saintube <saintube@foxmail.com>
@saintube saintube requested review from eahydra, zwzhang0107 and jasonliu747 and removed request for zwzhang0107 April 28, 2022 09:23
Copy link
Member

@jasonliu747 jasonliu747 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

/lgtm

@zwzhang0107
Copy link
Contributor

/lgtm

@hormes
Copy link
Member

hormes commented Apr 28, 2022

/approve

@koordinator-bot
Copy link

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: hormes

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@koordinator-bot koordinator-bot bot merged commit 5915884 into koordinator-sh:main Apr 28, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[feature request] supports memory qos strategy
6 participants