-
Notifications
You must be signed in to change notification settings - Fork 4.1k
cli,server: set reasonable GOGC by default #115164
Copy link
Copy link
Closed
Labels
C-enhancementSolution expected to add code/behavior + preserve backward-compat (pg compat issues are exception)Solution expected to add code/behavior + preserve backward-compat (pg compat issues are exception)O-supportWould prevent or help troubleshoot a customer escalation - bugs, missing observability/tooling, docsWould prevent or help troubleshoot a customer escalation - bugs, missing observability/tooling, docsO-testclusterIssues found or occurred on a test cluster, i.e. a long-running internal clusterIssues found or occurred on a test cluster, i.e. a long-running internal clusterP-1Issues/test failures with a fix SLA of 1 monthIssues/test failures with a fix SLA of 1 monthT-kvKV TeamKV Team
Metadata
Metadata
Assignees
Labels
C-enhancementSolution expected to add code/behavior + preserve backward-compat (pg compat issues are exception)Solution expected to add code/behavior + preserve backward-compat (pg compat issues are exception)O-supportWould prevent or help troubleshoot a customer escalation - bugs, missing observability/tooling, docsWould prevent or help troubleshoot a customer escalation - bugs, missing observability/tooling, docsO-testclusterIssues found or occurred on a test cluster, i.e. a long-running internal clusterIssues found or occurred on a test cluster, i.e. a long-running internal clusterP-1Issues/test failures with a fix SLA of 1 monthIssues/test failures with a fix SLA of 1 monthT-kvKV TeamKV Team
We started setting a reasonable default value for the
GOMEMLIMITenv var in 2e6ae80. Doing so has reduced OOMs without introducing issues.We should do the same for the
GOGCenv var, using the debug.SetGCPercent API.To do this, we need to pick a reasonable value for the configuration. 100% (the current default) isn't great because it often runs into the problem described in this blog post which results in an overactive GC. A larger value (e.g. 900%) would avoid some of these issues with small heaps on large systems. Alternatively, we could disable the GC percent heuristic (
GOGC=off) and rely entirely on theGOMEMLIMITto bound memory, if we trust that it has been configured correctly.https://tip.golang.org/doc/gc-guide serves as a good reference for GC knobs.
Jira issue: CRDB-33918
Epic CRDB-32846