-
Notifications
You must be signed in to change notification settings - Fork 27
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
agent: Add per-VM metric for desired CU(s) #1108
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
No changes to the coverage.
HTML Report |
693b601
to
a3cf0fa
Compare
c9f1d75
to
fe3b019
Compare
a3cf0fa
to
16c0917
Compare
fe3b019
to
244473b
Compare
16c0917
to
d2b4d45
Compare
244473b
to
8008093
Compare
d2b4d45
to
8c60b7f
Compare
8008093
to
8639da0
Compare
Omrigan
reviewed
Dec 20, 2024
8639da0
to
4b94cae
Compare
f4f9b64
to
4b94cae
Compare
This commit adds a new per-VM metric: autoscaling_vm_desired_cu. It's based on the same "desired CU" information exposed by the scaling event reporting, but updated continuously instead of being rate limited to avoid spamming our reporting. The metric has the same base labels as the other per-VM metrics, with the addition of the "reason" label, which is one of: * "total" - the goal CU, after taking the maximum of the individual parts and rounding up to the next unit. * "cpu" - goal CU size in order to fit the current CPU usage * "mem" - goal CU size in order to fit the current memory usage, which includes some assesssment * "lfc" - goal CU size in order to fit the estimated working set size All of these values are also multiplied by the same Compute Unit factor as with the normal scaling event reporting, so that Neon's fractional compute units are exposed as such in the metrics, even as we use integer compute units in the autoscaler-agent. Also note that all values except "total" are NOT rounded, and instead show the fractional amounts to allow better comparison. KNOWN LIMITATION: If ReportDesiredScaling is disabled at runtime for a particular VM, the metrics will not be cleared, and instead will just cease to be updated. I figured this is a reasonable trade-off for simplicity.
4b94cae
to
ed0cf86
Compare
Omrigan
approved these changes
Feb 10, 2025
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.
Only nits.
Tested on staging, looks good :D ref https://neondb.slack.com/archives/C03TN5G758R/p1739221210836759 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This commit adds a new per-VM metric:
autoscaling_vm_desired_cu
.It's based on the same "desired CU" information exposed by the scaling event reporting, but updated continuously instead of being rate limited to avoid spamming our reporting.
The metric has the same base labels as the other per-VM metrics, with the addition of the "component" label, which is one of:
total
- the goal CU, after taking the maximum of the individual parts and rounding up to the next unit.cpu
- goal CU size in order to fit the current CPU usagemem
- goal CU size in order to fit the current memory usage (including some information derived from LFC, to make sure there's room for cache too)lfc
- goal CU size in order to fit the estimated working set sizeAll of these values are also multiplied by the same Compute Unit factor as with the normal scaling event reporting, so that Neon's fractional compute units are exposed as such in the metrics, even as we use integer compute units in the autoscaler-agent.
Also note that all values except "total" are NOT rounded, and instead show the fractional amounts to allow better comparison.
KNOWN LIMITATION: If
ReportDesiredScaling
is disabled at runtime for a particular VM, the metrics will not be cleared, and instead will just cease to be updated. I figured this is a reasonable trade-off for simplicity.Notes for review: Tested this locally with the following patch to vm-deploy.yaml:
AFAICT it works as intended, but metrics are sometimes tricky. I plan to test it on staging before merging.
Also note: This PR builds on #1107 and must not be merged before it.