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

ResourceUtilization is for VM instead of POD in cosmic #5495

Open
guoqiangzhou opened this issue Oct 9, 2024 · 2 comments
Open

ResourceUtilization is for VM instead of POD in cosmic #5495

guoqiangzhou opened this issue Oct 9, 2024 · 2 comments
Assignees
Labels
bug This issue describes a behavior which is not expected - a bug. untriaged

Comments

@guoqiangzhou
Copy link

Description

when I ran this code in cosmic, the resource I got is for the VM instead of the Pod. I tried both latest version of IResourceUtilizationTracker and IResourceMonitor.
what I got is like this:

L:Information | Resource Monitoring is running inside a Job Object. For more information about Job Objects see
https://aka.ms/job-objects

L:Debug | System resources information: CpuLimit = 32, CpuRequest = 32, MemoryLimit = 137438482432, MemoryRequest = 137438482432.

but actually, our configuration for Pod in cosmic is: CPU limit = 5, and MemoryRequest is 28Gi.

For met, this package does not work at all. Or anything I am missing? please help to check.

Reproduction Steps

My code:

  1. register service:
    serviceCollection.AddResourceMonitoring(builder =>
    builder.ConfigureMonitor(options =>
    {
    options.CpuConsumptionRefreshInterval = TimeSpan.FromSeconds(30);
    options.MemoryConsumptionRefreshInterval = TimeSpan.FromSeconds(30);
    options.SamplingInterval = TimeSpan.FromSeconds(10);
    options.CollectionWindow = TimeSpan.FromSeconds(600);
    }));

  2. get utilization:
    IResourceMonitor monitor = Hosting.HostInstance.Services.GetService();
    return monitor?.GetUtilization(TimeSpan.FromMinutes(5));

Expected behavior

expected: CpuLimit = 5, CpuRequest = 5, MemoryLimit = 28G, MemoryRequest = 28G

Actual behavior

CpuLimit = 32, CpuRequest = 32, MemoryLimit = 137438482432, MemoryRequest = 137438482432

Regression?

No response

Known Workarounds

No response

Configuration

No response

Other information

No response

@guoqiangzhou guoqiangzhou added bug This issue describes a behavior which is not expected - a bug. untriaged labels Oct 9, 2024
@RussKie
Copy link
Member

RussKie commented Oct 10, 2024

@mobratil @evgenyfedorov2 could you please investigate?

@evgenyfedorov2 evgenyfedorov2 self-assigned this Oct 10, 2024
@evgenyfedorov2
Copy link
Contributor

Discussing internally

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug This issue describes a behavior which is not expected - a bug. untriaged
Projects
None yet
Development

No branches or pull requests

3 participants