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(sysadvisor): skip the containers if cache usage less then… #297

Merged
merged 1 commit into from
Oct 18, 2023

Conversation

cheney-lin
Copy link
Member

… threshold when reaping cache

What type of PR is this?

Enhancements

What this PR does / why we need it:

Which issue(s) this PR fixes:

Special notes for your reviewer:

@cheney-lin cheney-lin force-pushed the dev/skip_low_cache_usage branch from 2b13081 to 8acce7e Compare September 26, 2023 12:22
@codecov
Copy link

codecov bot commented Sep 26, 2023

Codecov Report

Attention: 78 lines in your changes are missing coverage. Please review.

Comparison is base (35c0eb0) 53.39% compared to head (78a2d7b) 53.31%.
Report is 2 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #297      +/-   ##
==========================================
- Coverage   53.39%   53.31%   -0.09%     
==========================================
  Files         401      403       +2     
  Lines       43913    43998      +85     
==========================================
+ Hits        23448    23458      +10     
- Misses      17878    17966      +88     
+ Partials     2587     2574      -13     
Flag Coverage Δ
unittest 53.31% <58.94%> (-0.09%) ⬇️

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

Files Coverage Δ
cmd/base/context_fake.go 71.52% <100.00%> (+4.16%) ⬆️
cmd/base/options/auth.go 71.42% <100.00%> (+9.89%) ⬆️
...kg/util/credential/authorization/authorizations.go 80.64% <100.00%> (ø)
pkg/util/credential/authorization/insecure.go 100.00% <100.00%> (ø)
pkg/util/credential/credentials.go 70.00% <100.00%> (ø)
pkg/util/credential/insecure.go 84.61% <100.00%> (ø)
...advisor/qosaware/resource/memory/memory_advisor.go 62.06% <66.66%> (+0.53%) ⬆️
pkg/util/credential/authorization/static.go 28.57% <0.00%> (ø)
...advisor/qosaware/resource/memory/plugins/common.go 80.00% <80.00%> (ø)
pkg/custom-metric/store/local/local_store.go 67.67% <0.00%> (-0.35%) ⬇️
... and 8 more

... and 12 files with indirect coverage changes

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

@cheney-lin cheney-lin force-pushed the dev/skip_low_cache_usage branch 3 times, most recently from a52259b to 7088198 Compare September 26, 2023 12:53
@cheney-lin cheney-lin self-assigned this Sep 26, 2023
@cheney-lin cheney-lin added enhancement New feature or request workflow/need-review review: test succeeded, need to review labels Sep 26, 2023
@@ -247,6 +247,8 @@ func (ra *memoryResourceAdvisor) detectNUMAPressure(numaID int) (*types.MemoryPr
if free < criticalWatermark {
pressureState = types.MemoryPressureDropCache
targetReclaimed.Set(int64(2*criticalWatermark - free))
} else if free < 2*criticalWatermark {
Copy link
Collaborator

Choose a reason for hiding this comment

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

for those magic numbers, pls use const vars (along with a brief introduction)

containers := make([]*types.ContainerInfo, 0)
cp.metaReader.RangeContainer(func(podUID string, containerName string, containerInfo *types.ContainerInfo) bool {
if cp.reclaimedContainersFilter(containerInfo) {
if cp.reclaimedContainersFilter(containerInfo, -1, minCacheUtilizationThreshold) {
Copy link
Collaborator

Choose a reason for hiding this comment

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

pls use const vars defined in pb package instead of -1 here

… threshold when reaping cache

Signed-off-by: linzhecheng <linzhecheng@bytedance.com>
@cheney-lin cheney-lin force-pushed the dev/skip_low_cache_usage branch from 7088198 to 78a2d7b Compare October 17, 2023 10:58
@cheney-lin cheney-lin added workflow/merge-ready merge-ready: code is ready and can be merged and removed workflow/need-review review: test succeeded, need to review labels Oct 18, 2023
@waynepeking348 waynepeking348 merged commit 2a09f2b into kubewharf:main Oct 18, 2023
11 checks passed
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/merge-ready merge-ready: code is ready and can be merged
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants