mirror of
https://github.com/ClusterCockpit/cc-metric-store.git
synced 2026-03-03 07:07:29 +01:00
Bringing back GOGC for syncPool
This commit is contained in:
@@ -11,6 +11,7 @@ import (
|
|||||||
"fmt"
|
"fmt"
|
||||||
"os"
|
"os"
|
||||||
"os/signal"
|
"os/signal"
|
||||||
|
"runtime/debug"
|
||||||
"sync"
|
"sync"
|
||||||
"syscall"
|
"syscall"
|
||||||
|
|
||||||
@@ -24,6 +25,10 @@ import (
|
|||||||
"github.com/google/gops/agent"
|
"github.com/google/gops/agent"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
const (
|
||||||
|
envGOGC = "GOGC"
|
||||||
|
)
|
||||||
|
|
||||||
var (
|
var (
|
||||||
date string
|
date string
|
||||||
commit string
|
commit string
|
||||||
@@ -57,6 +62,11 @@ func runServer(ctx context.Context) error {
|
|||||||
|
|
||||||
metricstore.Init(mscfg, config.GetMetrics(), &wg)
|
metricstore.Init(mscfg, config.GetMetrics(), &wg)
|
||||||
|
|
||||||
|
// Set GC percent if not configured
|
||||||
|
if os.Getenv(envGOGC) == "" {
|
||||||
|
debug.SetGCPercent(15)
|
||||||
|
}
|
||||||
|
|
||||||
if config.Keys.BackendURL != "" {
|
if config.Keys.BackendURL != "" {
|
||||||
ms := metricstore.GetMemoryStore()
|
ms := metricstore.GetMemoryStore()
|
||||||
ms.SetNodeProvider(api.NewBackendNodeProvider(config.Keys.BackendURL))
|
ms.SetNodeProvider(api.NewBackendNodeProvider(config.Keys.BackendURL))
|
||||||
|
|||||||
Reference in New Issue
Block a user