-
Notifications
You must be signed in to change notification settings - Fork 4.3k
feat(recommender): add round cpu millicores #7682
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
Conversation
Signed-off-by: Omer Aplatony <[email protected]>
Signed-off-by: Omer Aplatony <[email protected]>
| humanizeMemory = flag.Bool("humanize-memory", false, "Convert memory values in recommendations to the highest appropriate SI unit with up to 2 decimal places for better readability.") | ||
| roundCPUMillicores = flag.Int("round-cpu-millicores", 1, `CPU recommendation rounding factor in millicores. The CPU value will be rounded to the nearest multiple of this factor.`) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm curious what others think, but I like the idea of these two options being similar.
humanize-memory + humanize-cpu
or
round-memory-mebibyte + round-cpu-millicores
I haven't though through if this is possible or not. So I'm unsure if my idea is a good one or not, but for some reason keeping the options similar just feels like it may be a good user experience.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do you mean you want to combine these two flags into a single one?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That is another option...
--humanize=cpu,memory
Or two flags:
--humanize-memory=true/false
--humanize-cpu=true/false
I'm not strongly opinionated on the direction we go, I do think more opinions may be useful
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
but the cpu rounding depends on the user input, as it rounds to the nearest multiple of a specified factor. So, I'm not sure how the boolean flag is helpful here - unless you're suggesting that we should always round to a specific factor.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
unless you're suggesting that we should always round to a specific factor.
☝️ this
Does it make sense to have the "memory rounding feature" and the "cpu rounding feature" to operate in similar ways? Either ask a user to input a factor, or to use the humanize feature for both
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
They would select the mebibyte's to round up to
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
(I don't know if this is a good idea or not, to be honest)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
But if the user would want GiB? or TiB (not sure it's possible but still )..
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Aaaahhhhhh, ok! I see the problem now.
They are both "rounding", but the difference between a few millicore, or a few memory units (GiB, TiB) is quite different.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yup!
| --humanize-memory=true | ||
| ``` | ||
|
|
||
| ## CPU Recommendation Rounding |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
+1 for adding docs as the feature is added! This is a habit we need to be getting into
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yup! Thank you :)
Co-authored-by: Adrian Moisey <[email protected]>
|
Don't forget to run vpa-generate-flags.go |
Signed-off-by: Omer Aplatony <[email protected]>
|
/milestone vertical-pod-autoscaler-1.4.0 |
|
/lgtm |
|
Just fiy, there are some bugs around memory implementation of humanize, see #7770 (might affect this one as well if it has followed the same approach) |
I know about this bug, but this change is simpler and doesn’t use the humanize memory method. |
raywainman
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Small documentation nit then this is good to go, thanks Omer! :)
| lowerBoundMemoryPercentile = flag.Float64("recommendation-lower-bound-memory-percentile", 0.5, `Memory usage percentile that will be used for the lower bound on memory recommendation.`) | ||
| upperBoundMemoryPercentile = flag.Float64("recommendation-upper-bound-memory-percentile", 0.95, `Memory usage percentile that will be used for the upper bound on memory recommendation.`) | ||
| humanizeMemory = flag.Bool("humanize-memory", false, "Convert memory values in recommendations to the highest appropriate SI unit with up to 2 decimal places for better readability.") | ||
| roundCPUMillicores = flag.Int("round-cpu-millicores", 1, `CPU recommendation rounding factor in millicores. The CPU value will be rounded to the nearest multiple of this factor.`) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we specify that it is always rounded up?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, I agree: 6645e94
Signed-off-by: Omer Aplatony <[email protected]>
No problem :) |
| VPA can provide CPU recommendations rounded to user-specified values, making it easier to interpret and configure resources. This feature is controlled by the `--round-cpu-millicores` flag in the recommender component. | ||
|
|
||
| When enabled, CPU recommendations will be: | ||
| - Rounded to the nearest multiple of the specified millicore value | ||
| - Applied to target, lower bound, and upper bound recommendations | ||
|
|
||
| For example, with `--round-cpu-millicores=50`, a CPU recommendation of `79m` would be rounded to `100m`, and a recommendation of `34m` would be rounded to `50m`. | ||
|
|
||
| To enable this feature, set the --round-cpu-millicores flag when running the VPA recommender: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does it also make sense to say "rounded up" in this section? Just to drive home that it's up, not down.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added in a6a1e1c
Signed-off-by: Omer Aplatony <[email protected]>
|
/lgtm /approve Thanks! |
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: omerap12, raywainman The full list of commands accepted by this bot can be found here. The pull request process is described here DetailsNeeds approval from an approver in each of these files:
Approvers can indicate their approval by writing |
What type of PR is this?
/kind feature
What this PR does / why we need it:
Adds the
--round-cpu-millicoresflag to the VPA recommender, enabling user-configurable rounding of CPU recommendations.Which issue(s) this PR fixes:
Fixes #7678
Special notes for your reviewer:
Does this PR introduce a user-facing change?
Additional documentation e.g., KEPs (Kubernetes Enhancement Proposals), usage docs, etc.: