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(env): support GOGC default value #7776

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

dongjiang1989
Copy link
Contributor

@dongjiang1989 dongjiang1989 commented Sep 23, 2024

  • I added CHANGELOG entry for this change.
  • Change is not relevant to the end user.

Changes

Adjust from the Go default of 100 to 75 to reduce wasted memory.

Verification

Signed-off-by: dongjiang1989 <[email protected]>
Copy link
Contributor

@pedro-stanaka pedro-stanaka left a comment

Choose a reason for hiding this comment

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

I would rather have the default behavior from the runtime as the default value, and let users decide what works best for them.

@@ -45,6 +46,10 @@ import (
// Name is the name registered for the proto compressor.
const Name = "proto"

// Use lower GOGC if it isn't set yet.
// It is recommended increasing GOGC if go_memstats_gc_cpu_fraction exceeds 0.05 for extended periods of time.
const DefaultGOGC = 75
Copy link
Contributor

Choose a reason for hiding this comment

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

Shouldn't the user be responsible for tweaking this to make it work for their setup? I believe some CPU heavy/bound workloads like receivers will suffer from this.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes. For advanced users it is reserved for the user to adjust it to suit their setup, but in container scenarios giving it a default value (which is pretty good) is more suitable for most scenarios.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants