From 8ed9a5d5ca62dca27efbd3c25af12650061ed96d Mon Sep 17 00:00:00 2001 From: Remco Date: Thu, 19 May 2016 17:31:32 +0200 Subject: [PATCH] added numprocs --- transfersh-server/main.go | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/transfersh-server/main.go b/transfersh-server/main.go index 21b7201..7b34fdc 100644 --- a/transfersh-server/main.go +++ b/transfersh-server/main.go @@ -29,15 +29,17 @@ import ( // _ "transfer.sh/app/utils" "flag" "fmt" - "github.com/PuerkitoBio/ghost/handlers" - "github.com/gorilla/mux" "log" "math/rand" "mime" "net/http" "net/url" "os" + "runtime" "time" + + "github.com/PuerkitoBio/ghost/handlers" + "github.com/gorilla/mux" ) const SERVER_INFO = "transfer.sh" @@ -73,6 +75,10 @@ func init() { func main() { rand.Seed(time.Now().UTC().UnixNano()) + nCPU := runtime.NumCPU() + runtime.GOMAXPROCS(nCPU) + fmt.Println("Number of CPUs: ", nCPU) + r := mux.NewRouter() r.PathPrefix("/scripts/").Methods("GET").Handler(http.FileServer(http.Dir("./static/")))