From f6113264f4fdae30528dfc5f0f5867faf0a667ba Mon Sep 17 00:00:00 2001 From: Harshavardhana Date: Mon, 21 Mar 2022 19:05:04 -0700 Subject: [PATCH] add detection for GOMAXPROCS < NumCPU --- cmd/server-main.go | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/cmd/server-main.go b/cmd/server-main.go index c299aae22..e99e41790 100644 --- a/cmd/server-main.go +++ b/cmd/server-main.go @@ -28,6 +28,7 @@ import ( "math/rand" "os" "os/signal" + "runtime" "strings" "sync" "syscall" @@ -453,6 +454,12 @@ func serverMain(ctx *cli.Context) { logger.Info(color.RedBold("WARNING: Detected Linux kernel version older than 4.0.0 release, there are some known potential performance problems with this kernel version. MinIO recommends a minimum of 4.x.x linux kernel version for best performance")) } + maxProcs := runtime.GOMAXPROCS(0) + cpuProcs := runtime.NumCPU() + if maxProcs < cpuProcs { + logger.Info(color.RedBold("WARNING: Detected GOMAXPROCS(%d) < NumCPU(%d), please make sure to provide all PROCS to MinIO for optimal performance", maxProcs, cpuProcs)) + } + // Configure server. handler, err := configureServerHandler(globalEndpoints) if err != nil {