diff --git a/gorush.go b/gorush.go index 02d1079..fa37bcf 100644 --- a/gorush.go +++ b/gorush.go @@ -5,6 +5,7 @@ import ( "fmt" "log" "os" + "runtime" "strconv" "github.com/appleboy/gorush/config" @@ -82,6 +83,10 @@ func createPIDFile() error { return nil } +func init() { + runtime.GOMAXPROCS(runtime.NumCPU()) +} + func main() { opts := config.ConfYaml{}