Live data from Hacker News

We should get rid of average CPU utilization

theocharis.dev

21–25 of 25 posts

Re: We should get rid of average CPU utilization

#21
post #17

I've learned the hard way that CPU resource limits in K8S are a bad idea, as can be seen in this post. Just use CPU requests without limits so the scheduler has an estimate of your applications CPU requirements, but it can burst to use more CPU when it's available. With memory of course you should set a limit and from experience it should be the same as your memory requests.

There is also the concern that a single pod shouldn’t be able to take down an entire node. So there needs to be some safety levels. But then also not. I find this is a really complex issue which is not widely known (only in Kubernetes bubble)

you can reserve node resources for system processes so the pods don't kill the node using some kubelet parameters: https://kubernetes.io/docs/tasks/administer-cluster/reserve-...

Re: We should get rid of average CPU utilization

#22

No, not at all. Why get rid of a low-level statistical measure? It's not even quite clear what the article argues against. htop doesn't even show you "average CPU utilization", it provides a sample of the current CPU utilization. To me the problem appears to be that they try to do some hard realtime computing with strict time guarantees, but are so far up the stack (golang library, golang scheduler, docker, kubernete…

> It's not even quite clear what the article argues against.

I think it can be summed up as “average CPU utilization, which is the common and intuitive first check doesn’t tell you the real story”

I would also suggest that these are “outdated” measurements as common CPU metrics are really designed for moderately multi-threaded, single-foreground-application on bare metal

To your point, someone who deeply understands the stack already knows these are not the metrics to look at, but this is clearly aimed at people who have not (yet) had to dive deep to figure out a scheduling issue

Re: We should get rid of average CPU utilization

#23
post #17

I've learned the hard way that CPU resource limits in K8S are a bad idea, as can be seen in this post. Just use CPU requests without limits so the scheduler has an estimate of your applications CPU requirements, but it can burst to use more CPU when it's available. With memory of course you should set a limit and from experience it should be the same as your memory requests.

This, very much. With memory, I have seen one or two use cases where it made sense to have bigger limits than requests but it's the exception rather than the norm.

Re: We should get rid of average CPU utilization

#24
post #10

Earlier quoted context omitted.

Writing better code is of course out of the question.

Shockingly many developers have never profiled any code in their life.

The nice thing about such code is that, when you come in to improve it, you can make huge improvements in no time. As a user, though...

Re: We should get rid of average CPU utilization

#25
I've worked with plenty of companies that provide some sort of hosting for enterprise customers, and the number of times I've seen even senior admins use only CPU Utilisation and Memory In-Use investigating an issue is disheartening. And given that CPU Utilisation is an aggregate of all time != CPU idle, the same utilisation number can mean very different underlying system states.

There's something like a dozen different CPU metrics that can be referred to by the OS alone.

Post reply on HN