From fc4ae14e4ef602fd963a08f61b50f5399cd1494a Mon Sep 17 00:00:00 2001 From: Aditya Ujeniya Date: Sun, 15 Feb 2026 21:50:03 +0100 Subject: [PATCH] Bringing back GOGC for syncPool --- cmd/cc-metric-store/main.go | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/cmd/cc-metric-store/main.go b/cmd/cc-metric-store/main.go index 160af7a..c1c03e7 100644 --- a/cmd/cc-metric-store/main.go +++ b/cmd/cc-metric-store/main.go @@ -11,6 +11,7 @@ import ( "fmt" "os" "os/signal" + "runtime/debug" "sync" "syscall" @@ -24,6 +25,10 @@ import ( "github.com/google/gops/agent" ) +const ( + envGOGC = "GOGC" +) + var ( date string commit string @@ -57,6 +62,11 @@ func runServer(ctx context.Context) error { metricstore.Init(mscfg, config.GetMetrics(), &wg) + // Set GC percent if not configured + if os.Getenv(envGOGC) == "" { + debug.SetGCPercent(15) + } + if config.Keys.BackendURL != "" { ms := metricstore.GetMemoryStore() ms.SetNodeProvider(api.NewBackendNodeProvider(config.Keys.BackendURL))