From 6ccee2c4a537f0ebcab79522710635e987c86282 Mon Sep 17 00:00:00 2001 From: SuperQ Date: Mon, 10 Jun 2024 09:34:55 +0200 Subject: [PATCH 1/2] Tune default GOGC Adjust the default GOGC value to 75. This is less of a memory savings, but has less impact on CPU use. Signed-off-by: SuperQ --- config/config.go | 2 +- docs/configuration/configuration.md | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/config/config.go b/config/config.go index d02081d2e1..9defa10d48 100644 --- a/config/config.go +++ b/config/config.go @@ -154,7 +154,7 @@ var ( DefaultRuntimeConfig = RuntimeConfig{ // Go runtime tuning. - GoGC: 50, + GoGC: 75, } // DefaultScrapeConfig is the default scrape configuration. diff --git a/docs/configuration/configuration.md b/docs/configuration/configuration.md index 26c088e135..f0e13cf136 100644 --- a/docs/configuration/configuration.md +++ b/docs/configuration/configuration.md @@ -125,7 +125,7 @@ runtime: # Configure the Go garbage collector GOGC parameter # See: https://tip.golang.org/doc/gc-guide#GOGC # Lowering this number increases CPU usage. - [ gogc: | default = 50 ] + [ gogc: | default = 75 ] # Rule files specifies a list of globs. Rules and alerts are read from # all matching files. From 38bf349ff774d45708a994519b1636d47bcbf721 Mon Sep 17 00:00:00 2001 From: SuperQ Date: Tue, 11 Jun 2024 11:18:13 +0200 Subject: [PATCH 2/2] Update changelog for GOGC tuning Include #14285 in changelog. Signed-off-by: SuperQ --- CHANGELOG.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 0bc3abd71e..e902a775f2 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,10 @@ ## unreleased +This release changes the default for GOGC, the Go runtime control for the trade-off between excess memory use and CPU usage. We have found that Prometheus operates with minimal additional CPU usage, but greatly reduced memory by adjusting the upstream Go default from 100 to 75. + +* [CHANGE] Runtime: Change GOGC threshold from 50 to 75 #14285 + ## 2.53.0-rc.0 / 2024-06-06 This release changes the default for GOGC, the Go runtime control for the trade-off between excess memory use and CPU usage. We have found that Prometheus operates with minimal additional CPU usage, but greatly reduced memory by adjusting the upstream Go default from 100 to 50.