Set GOMAXPROCS at runtime to CPU number
This commit is contained in:
parent
fbe34c6083
commit
1bf7f5c7e4
1 changed files with 4 additions and 0 deletions
4
main.go
4
main.go
|
@ -17,6 +17,8 @@ package main
|
|||
import (
|
||||
"os"
|
||||
|
||||
"runtime"
|
||||
|
||||
"github.com/pkg/profile"
|
||||
|
||||
"github.com/abcum/surreal/cli"
|
||||
|
@ -33,6 +35,8 @@ func main() {
|
|||
defer profile.Start(profile.BlockProfile, profile.ProfilePath("."), profile.NoShutdownHook).Stop()
|
||||
}
|
||||
|
||||
runtime.GOMAXPROCS(runtime.NumCPU())
|
||||
|
||||
cli.Init()
|
||||
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue