Skip to content

Support cgroup_v2 to prevent memory issues with newer linux kernels #1313

Description

@horihel

Is your feature request related to a problem? Please describe.
We've noticed that if we run mongodb_exporter on Rancher Desktop (windows) with the latest WSL kernel( 6.18.33.2-microsoft-standard-WSL2), exporter tends to require a lot more memory and easily gets OOMKilled.

Some debugging sessions and searching found that go kind-of support cgroupsv1 but does not (and might not in the future) support cgroupv2 at all, resulting in GOMEMLIMIT being the machine limit instead of the pod limit.

This results in mongodb_exporter being unreliable in k8s - we still have time as most cloud providers don't yet run on a recent enough kernel and support for Ubuntu 26.04 (which includes a kernel without cgroups1) has not gotten too much traction yet - but that's going to happen soon.

Describe the solution you'd like
Workaround is to manually set GOMEMLIMIT to a value that corresponds to slightly under the pod memlimit - lots of manual work and lots of experimentation necessary for every deployer.

Another solution is using https://github.com/KimMachineGun/automemlimit - i found this in the grafana sources and docs, which is supposed to solve the problem automatically and allows the developer to set limt that works with the application.

Describe alternatives you've considered
The alternative I see is documenting the problem and asking everyone to add the GOMEMLIMIT env variable. Helm chart users might have the advantage of someone generating a templated version for it.

Additional context
Add any other context or screenshots related to the feature request here.

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions