Skip to content

Conversation

@aryanxgupta
Copy link

What this PR does:
Hi,
This PR implements the automemlimit feature requested in issue #7064.

I've followed the Prometheus implementation as a reference, adding the simple SetGoMemLimitWithOpts call at the start of cmd/cortex/main.go and using the project's logger. I did not add the complex flag/config logic which was mentioned in the reference PR.

Note on Tests:
I ran make test locally. The build succeeded and the tests for cmd/cortex passed. However, the test run failed in pkg/alertmanager and pkg/compactor. These appear to be unrelated, so I'm relying on the CI to run the full suite.

Which issue(s) this PR fixes:
Fixes #7064

Checklist

  • Tests updated (No new tests were needed for this change)
  • Documentation added (No documentation changes were needed)
  • CHANGELOG.md updated - I'm not sure if a changelog entry is needed for this. Please let me know if I should add one

Signed-off-by: aryanxgupta <itss.aryan@gmail.com>
Copy link
Contributor

@yeya24 yeya24 left a comment

Choose a reason for hiding this comment

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

Thanks @aryanxgupta. I think this approach works but this behavior should be behind a feature flag, similar to what Prometheus does. We need a flag to enable auto memlimit and another flag to set auto memlimit ratio.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Support Go AutoMemLimit

2 participants