Skip to content
This repository has been archived by the owner on Dec 1, 2021. It is now read-only.

Not an issue but another CPU query #581

Open
alibowl opened this issue Jan 25, 2021 · 3 comments
Open

Not an issue but another CPU query #581

alibowl opened this issue Jan 25, 2021 · 3 comments

Comments

@alibowl
Copy link

alibowl commented Jan 25, 2021

Hi, we're currently trying out this release in one of our dev envs and noticed that the policy for cpu metric can only be between 1-100%.

I can find the code that implements this restriction which is fair enough. In our Env though CPU can go up to 200% as our Diego Cells are dual-core.

I'm running through the code to see what cpu metric is pulled out and i'm guessing it the same cpuPercentage from the loggregator v2 api as used in the command 'cf app [app name]' which shows cpu used. Is that right?

It wouldn't be using AbsoluteCPUUsage no? And i'm guessing not AbsoluteCPUEntitlement as that's experimental.

Any info would be good as i've been going down a rabbit hole following the code :-)

@cf-gitbot
Copy link
Collaborator

We have created an issue in Pivotal Tracker to manage this:

https://www.pivotaltracker.com/story/show/176632369

The labels on this github issue will be updated when the story is started.

@silvestre
Copy link
Member

silvestre commented Jan 25, 2021

Hi @alibowl ,

the cpu metric is processed in https://github.com/cloudfoundry/app-autoscaler/blob/develop/src/autoscaler/metricsserver/collector/envelope_processor.go#L127

This means the App Autoscaler uses CpuPercentage as described in https://docs.cloudfoundry.org/loggregator/container-metrics.html#container-metrics (c.f. https://github.com/cloudfoundry/diego-logging-client/blob/master/client.go#L218 for the CpuPercentage to cpu mapping).

I'd say in light of this restricting the cpu metric threshold to 1-100% is indeed a bug. Additionally we should look into also allowing to base policies on entitlement usage percentage or similar.

WDYT?

@alibowl
Copy link
Author

alibowl commented Jan 25, 2021

Hi @silvestre

I had a big reply written, but it was mostly describing many things people had talked about in the past (is cpu a good metric to use etc).

The thing is our customers want to be able to use the metric, whether it's good or bad. How you would know how many cores a diego cell has i'm not sure.

Being able to specify above 100% is good in our situation, whether you put an upper limit on that has pros and cons, as soon as you say 200%, what about diego-cells with 4 cores etc. Do you leave it a freely open value with no limit but give a warning?

We were also looking at https://www.cloudfoundry.org/blog/better-way-split-cake-cpu-entitlements/ and thought having that as an option would be handy, especially if this is the course Cloud Foundry would be taking going forward.

Like with all these things there is no 1 single correct answer, but selfishly we'd like to be able to go above 100% :-)

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

No branches or pull requests

3 participants