From 8001e7e94d164f0c0f72f516992c60e6010be49e Mon Sep 17 00:00:00 2001 From: dencoded <33698537+dencoded@users.noreply.github.com> Date: Fri, 6 Mar 2020 11:01:45 -0500 Subject: [PATCH] GOMAXPROCS is forced to number of CPU-cores --- main.go | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/main.go b/main.go index 6887915..d5e7545 100644 --- a/main.go +++ b/main.go @@ -12,12 +12,11 @@ import ( "os/signal" "runtime" - "github.com/indihub-space/agent/apiserver" - "google.golang.org/grpc" "google.golang.org/grpc/credentials" _ "google.golang.org/grpc/encoding/gzip" + "github.com/indihub-space/agent/apiserver" "github.com/indihub-space/agent/config" "github.com/indihub-space/agent/lib" "github.com/indihub-space/agent/logutil" @@ -50,6 +49,9 @@ var ( ) func init() { + // restrict number of system-threads to number of cores + runtime.GOMAXPROCS(runtime.NumCPU()) + flag.StringVar( &flagINDIServerManagerAddr, "indi-server-manager",