Fix utils.AdjustGoMaxProcs

Since Go 1.5, Go will use the total number of logical processers that the
system has available. Caveats to this are if someone has set the
GOMAXPROCS env var set or wish to limit usage of the number of logical processers
between a range from 1 to NumCPUs
This commit is contained in:
Adrian Gallagher
2019-10-03 10:12:44 +10:00
parent db317a2447
commit 8ca1e5c36f
4 changed files with 68 additions and 16 deletions

View File

@@ -4,6 +4,7 @@ import (
"errors"
"flag"
"fmt"
"runtime"
"sync"
"time"
@@ -293,6 +294,9 @@ func (e *Engine) Start() error {
e.Uptime = time.Now()
log.Debugf(log.Global, "Bot '%s' started.\n", e.Config.Name)
log.Debugf(log.Global, "Using data dir: %s\n", e.Settings.DataDir)
log.Debugf(log.Global,
"Using %d out of %d logical processors for runtime performance\n",
runtime.GOMAXPROCS(-1), runtime.NumCPU())
enabledExchanges := e.Config.CountEnabledExchanges()
if e.Settings.EnableAllExchanges {