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

CPU Utilization not properly reported in K8s env #36

Open
imochurad opened this issue May 1, 2023 · 1 comment
Open

CPU Utilization not properly reported in K8s env #36

imochurad opened this issue May 1, 2023 · 1 comment

Comments

@imochurad
Copy link

My application is containerized and runs in a K8S pod, here is the snippet:

var osu = require('node-os-utils')
var cpu = osu.cpu

let cpuUtilization: number = -1;

setInterval(async function () {
  cpu.usage()
    .then((cpuPercentage: number) => {
      cpuUtilization = cpuPercentage;
      logger.info(`Updating cpu utilization to cpuUtil=${cpuUtilization}`);
    });
}, 10 * 1000); // invoke every 10 seconds

Unfortunately, the library doesn't return correct value for POD utilization, the values never go over 35%, whereas on grafana dashboard Pods CPU utilization is reported to reach 100% with the CPU throttling taking place.

Is this a known issue?

@fbruffaert
Copy link

@imochurad have you made any progress since your post?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants