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

enhancement(eviction): load eviction support dynamic threshold #129

Merged

Conversation

zzzzhhb
Copy link
Collaborator

@zzzzhhb zzzzhhb commented Jul 4, 2023

What type of PR is this?

Enhancements

What this PR does / why we need it:

this pr support using dynamic threshold in load eviction plugin.

Which issue(s) this PR fixes:

Special notes for your reviewer:

@zzzzhhb zzzzhhb changed the title enhancement(eviction): load eviction support dynamic threshold [WIP]enhancement(eviction): load eviction support dynamic threshold Jul 4, 2023
@zzzzhhb zzzzhhb added the enhancement New feature or request label Jul 4, 2023
@zzzzhhb zzzzhhb force-pushed the load_eviction_dynamic_threshold branch from e0656fd to 0c9f496 Compare July 25, 2023 09:17
@zzzzhhb zzzzhhb added the workflow/need-review review: test succeeded, need to review label Jul 25, 2023
@codecov
Copy link

codecov bot commented Jul 25, 2023

Codecov Report

Patch coverage: 68.29% and project coverage change: +0.27% 🎉

Comparison is base (f9e16b5) 51.04% compared to head (3c89411) 51.32%.
Report is 1 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #129      +/-   ##
==========================================
+ Coverage   51.04%   51.32%   +0.27%     
==========================================
  Files         419      421       +2     
  Lines       40577    40641      +64     
==========================================
+ Hits        20713    20859     +146     
+ Misses      17604    17504     -100     
- Partials     2260     2278      +18     
Flag Coverage Δ
unittest 51.32% <68.29%> (+0.27%) ⬆️

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

Files Changed Coverage Δ
pkg/agent/evictionmanager/manager.go 42.03% <ø> (ø)
...gins/cpu/dynamicpolicy/cpueviction/cpu_eviciton.go 0.00% <0.00%> (ø)
...olicy/cpueviction/strategy/pressure_load_metric.go 88.63% <ø> (ø)
pkg/agent/qrm-plugins/cpu/dynamicpolicy/policy.go 43.66% <0.00%> (+0.23%) ⬆️
pkg/agent/sysadvisor/metacache/metacache.go 75.57% <ø> (ø)
...sysadvisor/plugin/metric-emitter/syncer/pod/pod.go 66.44% <ø> (ø)
...sor/plugin/qosaware/resource/cpu/advisor_helper.go 79.21% <ø> (+2.56%) ⬆️
...minqos/reclaimedresource/reclaimedresource_base.go 27.58% <0.00%> (-4.42%) ⬇️
pkg/metaserver/agent/metric/fake_metric.go 66.07% <30.00%> (-6.85%) ⬇️
...visor/plugin/metric-emitter/syncer/node/advisor.go 34.28% <34.28%> (ø)
... and 19 more

... and 11 files with indirect coverage changes

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@zzzzhhb zzzzhhb changed the title [WIP]enhancement(eviction): load eviction support dynamic threshold enhancement(eviction): load eviction support dynamic threshold Jul 25, 2023
sun-yuliang
sun-yuliang previously approved these changes Jul 26, 2023
@zzzzhhb zzzzhhb force-pushed the load_eviction_dynamic_threshold branch 2 times, most recently from c7fa022 to 3513f6b Compare July 27, 2023 06:43
@zzzzhhb zzzzhhb requested a review from sun-yuliang July 27, 2023 06:54
@@ -785,3 +800,803 @@ func TestGetTopEvictionPods(t *testing.T) {
})
}
}

func TestCPUPressureLoadEviction_collectMetrics(t *testing.T) {
pod1UID := "pod1"
Copy link
Collaborator

Choose a reason for hiding this comment

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

add t.Parallel() for all tests

@@ -313,6 +315,18 @@ func GetContainerAsyncWorkName(podUID, containerName, topic string) string {
return strings.Join([]string{podUID, containerName, topic}, "/")
}

func GetSystemReservedCores(conf *config.Configuration, machineInfo *machine.KatalystMachineInfo, allCPUs machine.CPUSet) (machine.CPUSet, error) {
Copy link
Collaborator

Choose a reason for hiding this comment

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

what's the difference with GetCoreNumsReservedForReclaim

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

There are two main differences:

  1. GetSystemReservedCores returns certain CPU IDs but GetCoreNumsReservedForReclaim only returns the amount of cores.
  2. GetSystemReservedCores is related to the cores reserved for system_cores qos but GetCoreNumsReservedForReclaim is about the cores reserved for reclaimed_cores qos.

I'll rename it to GetCoresReservedForSystem to make it more consistent.

@@ -391,6 +391,19 @@ func (ns *NUMANodeState) GetFilteredDefaultCPUSet(excludeEntry, excludeWholeNUMA
return res
}

// Exist returns true if the stated predicate holds true for some pods of this numa else it returns false.
func (ns *NUMANodeState) Exist(f func(ai *AllocationInfo) bool) bool {
Copy link
Collaborator

Choose a reason for hiding this comment

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

it's too wield to naming this function as Exist

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

actually it's a common function name in Java or Scala,😂 never mind, I'll rename it.

@zzzzhhb zzzzhhb requested a review from waynepeking348 July 27, 2023 12:06
@zzzzhhb zzzzhhb force-pushed the load_eviction_dynamic_threshold branch 2 times, most recently from 9bb8327 to 77758be Compare July 31, 2023 09:40
@zzzzhhb zzzzhhb force-pushed the load_eviction_dynamic_threshold branch from 77758be to 3f11832 Compare July 31, 2023 12:06
@zzzzhhb zzzzhhb force-pushed the load_eviction_dynamic_threshold branch from 3f11832 to 91f1891 Compare July 31, 2023 12:09
@waynepeking348 waynepeking348 merged commit 83bce0c into kubewharf:main Aug 1, 2023
luomingmeng pushed a commit to luomingmeng/katalyst-core that referenced this pull request Oct 11, 2024
…harf#129)

* enhancement(eviction): evict by share pool status

* enhancement(eviction): load eviction plugin use readonly state

* chore(eviction): make test parallel

* chore(eviction): rename some function and add some metric

* enhancement(eviction): extract GetPodPoolMapFunc interface

* enhancement(eviction): ignore isolation pool

* refine implementation for load pressure

---------

Co-authored-by: shaowei.wayne <shaowei.wayne@bytedance.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request workflow/need-review review: test succeeded, need to review
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants