Bringing back GOGC for syncPool

This commit is contained in:
Aditya Ujeniya
2026-02-15 21:50:03 +01:00
parent be6d4be9b9
commit fc4ae14e4e

View File

@@ -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))