Skip to content

Conversation

@rroberts2222
Copy link
Contributor

@rroberts2222 rroberts2222 commented Nov 1, 2022

Type of change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • This change requires a documentation update

Testing performed?

  • Unit tests
  • Integration tests
  • Acceptance tests

Checklist:

  • This PR is being made against the main branch, or relevant version branch
  • I have made corresponding changes to the documentation
  • I have added testing for my changes

If you have any questions, or want to get attention for a PR or issue please reach out on the #logging-and-metrics channel in the cloudfoundry slack

Signed-off-by: Ben Fuller [email protected]

@Benjamintf1 Benjamintf1 requested a review from ctlong November 1, 2022 18:23
Copy link
Member

@ctlong ctlong left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you please add more context to the commit message and/or the PR explaining why the bosh-agent algorithm for system memory percent is preferable to the algorithm that we currently use.

- Context from bosh engineers:

    Updating System Metrics Agent to use the same memory usage metric that the Bosh Agent uses, that is using MemAvailable over MemUsed. MemAvailable is a more reliable and correct metric than the older hand-calculation that folks do. It is a metric that's maintained by the kernel developers that is intended to tell users how much memory their application can use without causing the system to hit performance issues. This metric was [added back in 2014](https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=34e431b0a) by the kernel developers because the old way of calculating available memory was no longer correct due to changes in how Linux uses and frees memory. Furthermore, the kernel devs expected that more changes to kernel memory management would inevitably come, rendering incorrect any calculations based on what the kernel did in 2014. MemAvailable is a solid estimate of the maximum amount of memory that an application can use without causing performance problems, and is a metric that is updated to remain correct as the internal details of how the kernel manage memory change over time.

Signed-off-by: Ben Fuller <[email protected]>
Signed-off-by: Rebecca Roberts <[email protected]>
Signed-off-by: Ben Fuller <[email protected]>
@Benjamintf1 Benjamintf1 force-pushed the change-memory-calculation branch from 5ee4f12 to 6744fc6 Compare November 1, 2022 20:16
@Benjamintf1 Benjamintf1 requested a review from ctlong November 1, 2022 20:21
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

Successfully merging this pull request may close these issues.

3 participants