Skip to content

Conversation

nivebb8
Copy link
Contributor

@nivebb8 nivebb8 commented Apr 12, 2025

Microsoft Reviewers: Open in CodeFlow

Problem Statement:

  1. Current code is always assuming that container cgroup is at fixed location (/sys/fs/cgroup), which may not be the case always. The correct cgroup path should be retrieved from "/proc/self/cgroup" file.
    image
  2. We are using delta Host CPU for containers % of usages. A better option would be to use cpu limits (cpu.max) set by the Cgroups itself. Host CPU delta might change due to factors other than the container usages.

@nivebb8 nivebb8 changed the title Nive/v2decouple slices Read CPU metrics from slices value in /proc/self/cgroup Apr 12, 2025
@nivebb8 nivebb8 changed the title Read CPU metrics from slices value in /proc/self/cgroup [DRAFT] Read CPU metrics from slices value in /proc/self/cgroup Apr 12, 2025
@nivebb8
Copy link
Contributor Author

nivebb8 commented Apr 12, 2025

@nivebb8 please read the following Contributor License Agreement(CLA). If you agree with the CLA, please reply with the following information.

@dotnet-policy-service agree [company="{your company}"]

Options:

  • (default - no company specified) I have sole ownership of intellectual property rights to my Submissions and I am not making Submissions in the course of work for my employer.
@dotnet-policy-service agree
  • (when company given) I am making Submissions in the course of work for my employer (or my employer has intellectual property rights in my Submissions by contract or applicable law). I have permission from my employer to make Submissions and enter into this Agreement on behalf of my employer. By signing below, the defined term “You” includes me and my employer.
@dotnet-policy-service agree company="Microsoft"

Contributor License Agreement

@dotnet-policy-service agree company="Microsoft"

@evgenyfedorov2
Copy link
Member

I understand this is still in Draft state, but just a note - we will need to some Acceptance tests, similar to already existing one, where we emulate filesystem and test the library as a whole

Copy link

@swapniliit2222 swapniliit2222 left a comment

Choose a reason for hiding this comment

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

Added few review comments

@dotnet-policy-service dotnet-policy-service bot added the waiting-author-feedback 📭 The author of this issue needs to respond in order for us to continue investigating this issue. label Apr 15, 2025
@dotnet-policy-service dotnet-policy-service bot removed the waiting-author-feedback 📭 The author of this issue needs to respond in order for us to continue investigating this issue. label Apr 15, 2025
@nivebb8 nivebb8 requested a review from swapniliit2222 April 15, 2025 20:00
@nivebb8 nivebb8 marked this pull request as ready for review April 15, 2025 20:00
@nivebb8 nivebb8 requested a review from a team as a code owner April 15, 2025 20:00
@nivebb8 nivebb8 changed the title [DRAFT] Read CPU metrics from slices value in /proc/self/cgroup Read CPU metrics from slices value in /proc/self/cgroup Apr 15, 2025
@nivebb8 nivebb8 changed the title Read CPU metrics from slices value in /proc/self/cgroup Improve CPU metrics calculations for CgroupV2 Apr 16, 2025
Copy link
Member

@evgenyfedorov2 evgenyfedorov2 left a comment

Choose a reason for hiding this comment

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

Can we please have a test similar to this (of course we don't have to compare values with Tracker). The test will validate that the new logic picks up changes from file system as expected

@nivebb8
Copy link
Contributor Author

nivebb8 commented Apr 16, 2025

Can we please have a test similar to this (of course we don't have to compare values with Tracker). The test will validate that the new logic picks up changes from file system as expected

Added

@nivebb8 nivebb8 closed this Apr 16, 2025
@nivebb8 nivebb8 reopened this Apr 16, 2025
@evgenyfedorov2 evgenyfedorov2 enabled auto-merge (squash) April 16, 2025 12:36
@evgenyfedorov2 evgenyfedorov2 merged commit 9cf3533 into dotnet:main Apr 16, 2025
6 checks passed
@joperezr
Copy link
Member

/backport to release/9.4

Copy link
Contributor

Started backporting to release/9.4: https://github.com/dotnet/extensions/actions/runs/14520112091

@github-actions github-actions bot locked and limited conversation to collaborators May 18, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants