Skip to content

cli,server: set reasonable GOGC by default #115164

@nvb

Description

@nvb

We started setting a reasonable default value for the GOMEMLIMIT env var in 2e6ae80. Doing so has reduced OOMs without introducing issues.

We should do the same for the GOGC env 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 the GOMEMLIMIT to 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

Metadata

Metadata

Assignees

Labels

C-enhancementSolution 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, docsO-testclusterIssues found or occurred on a test cluster, i.e. a long-running internal clusterP-1Issues/test failures with a fix SLA of 1 monthT-kvKV Team

Type

No type

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions