Set GOMAXPROCS at runtime to CPU number

This commit is contained in:
Tobie Morgan Hitchcock 2016-11-26 13:39:48 +00:00
parent fbe34c6083
commit 1bf7f5c7e4

View file

@ -17,6 +17,8 @@ package main
import ( import (
"os" "os"
"runtime"
"github.com/pkg/profile" "github.com/pkg/profile"
"github.com/abcum/surreal/cli" "github.com/abcum/surreal/cli"
@ -33,6 +35,8 @@ func main() {
defer profile.Start(profile.BlockProfile, profile.ProfilePath("."), profile.NoShutdownHook).Stop() defer profile.Start(profile.BlockProfile, profile.ProfilePath("."), profile.NoShutdownHook).Stop()
} }
runtime.GOMAXPROCS(runtime.NumCPU())
cli.Init() cli.Init()
} }