Skip to content
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

feat: include memory limit in memory settings #1825

Merged
merged 3 commits into from
Nov 24, 2024

Conversation

blumamir
Copy link
Collaborator

For cluster collector, we currently populate the resource request for memory with default value of 500MiB.

However, we do not set a limit on the resource request.

This PR adds a limit for memory request for the cluster collector, set by default to 1.25 times the memory request, 625MiB by default. It is not expected to be reached, but set as protection to guarantee we supply a small slack for extreme bursts, but capping the memory at a reasonable size to protect the cluster

// while it cannot fully prevent OOMs, it can help in reducing the chances of OOMs in edge cases.
// the settings should prevent the collector from exceeding the memory request,
// so one can set this to the same value as the memory request or higher to allow for some buffer for bursts.
MemoryLimitMiB int `json:"memoryLimitMiB"`
Copy link
Contributor

Choose a reason for hiding this comment

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

Do you think it is better to configure this as relative to the MemoryRequest field? (i/e with precentages or fractions relative to the request amount.)

Comment on lines +43 to +47
// This option sets the limit on the memory usage of the collector.
// since the memory limiter mechanism is heuristic, and operates on fixed intervals,
// while it cannot fully prevent OOMs, it can help in reducing the chances of OOMs in edge cases.
// the settings should prevent the collector from exceeding the memory request,
// so one can set this to the same value as the memory request or higher to allow for some buffer for bursts.
Copy link
Contributor

Choose a reason for hiding this comment

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

Should we write the k8s value that will map into? and state that it will impact when the collector is OOMed?

Copy link
Contributor

@RonFed RonFed left a comment

Choose a reason for hiding this comment

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

Added a nit about the comments.

Also discussed offline about the need to make all the precntages sizes configurable

@blumamir blumamir merged commit 1b69e3d into odigos-io:main Nov 24, 2024
28 checks passed
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.

2 participants