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

Migrate deprecated memory_ballast extension to GOMEMLIMIT variable. #144

Open
sfqzlm opened this issue May 8, 2024 · 2 comments
Open

Migrate deprecated memory_ballast extension to GOMEMLIMIT variable. #144

sfqzlm opened this issue May 8, 2024 · 2 comments
Assignees
Labels
enhancement New feature or request helm Everything regarding the Helm chart

Comments

@sfqzlm
Copy link

sfqzlm commented May 8, 2024

Summary

Replace deprecated memory_ballast extension with GOMEMLIMIT variable.

The memory ballast extension is deprecated in favor of using the GOMEMLIMIT environment variable. This environment variable is available on any Collector built with Go 1.19 or higher.

Desired Behavior

Achieve the same functionality with GOMEMLIMIT variable.

Possible Solution

To migrate to GOMEMLIMIT, set its value to 80% of the hard memory limit of your Collector. For example, if the Collector hard memory limit is 1GiB, set GOMEMLIMIT to 800MiB.

env:
      # GOMEMLIMIT variable sets a soft memory limit for the runtime. It should be set to 80% of the hard memory limit of your collector.
    - name: GOMEMLIMIT
      value: 100MiB

Additional context

@sfqzlm sfqzlm added the enhancement New feature or request label May 8, 2024
@tvalchev2
Copy link

tvalchev2 commented May 8, 2024

I think this is a very good idea. Reading a bit about the difference I cannot help nut notice, that using GOMEMLIMIT instead of memory_ballast provides more predictable memory usage overall and less consumption for quite a few people out there:
open-telemetry/opentelemetry-collector#8343 (comment)

However is it possible to make the GOMEMLIMIT somehow adaptive based on the resource Limits provided? Instead of having to hardcode it? So let's say my collector has 1Gi memory Limit, then GOMEMLIMIT should be 80% of that (800MiB) but if I increase the Limit to 2Gi, then I should not have to also manually increase the GOMEMLIMIT to 1600MiB.

@utr1903 utr1903 self-assigned this May 21, 2024
@utr1903
Copy link
Contributor

utr1903 commented May 21, 2024

@sfqzlm Thanks a lot for the heads up! I'll fix that asap :)
@tvalchev2 It should be possible per Helm.

@utr1903 utr1903 added the helm Everything regarding the Helm chart label May 21, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request helm Everything regarding the Helm chart
Projects
Development

No branches or pull requests

3 participants