-
Notifications
You must be signed in to change notification settings - Fork 2.1k
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
base: main
Are you sure you want to change the base?
Conversation
Signed-off-by: dongjiang1989 <dongjiang1989@126.com>
There was a problem hiding this 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 |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
Signed-off-by: dongjiang <dongjiang1989@126.com>
Signed-off-by: dongjiang1989 <dongjiang1989@126.com>
调整默认 GOGC prometheus/prometheus#14285 |
Changes
Adjust from the Go default of 100 to 75 to reduce wasted memory.
Verification