From 3a5b8feb4ad4d042086051037c7deb531f1fa5ee Mon Sep 17 00:00:00 2001 From: Armon Dadgar Date: Sat, 22 Feb 2014 17:43:12 -0800 Subject: [PATCH] agent: Adding a check for GOMAXPROCS. Fixes #10. --- command/agent/command.go | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/command/agent/command.go b/command/agent/command.go index 31595cd93a..eab10c3db9 100644 --- a/command/agent/command.go +++ b/command/agent/command.go @@ -10,6 +10,7 @@ import ( "net" "os" "os/signal" + "runtime" "strings" "syscall" "time" @@ -189,6 +190,11 @@ func (c *Command) Run(args []string) int { } c.args = args + // Check GOMAXPROCS + if runtime.GOMAXPROCS(0) == 1 { + c.Ui.Error("WARNING: It is highly recommended to set GOMAXPROCS higher than 1") + } + // Setup the log outputs logGate, logWriter, logOutput := c.setupLoggers(config) if logWriter == nil {