Browse Source
Merge pull request #1943 from kmlebedev/maxCPUs
GOMAXPROCS use defaults to the value of runtime.NumCPU
pull/1945/head
Chris Lu
4 years ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with
0 additions and
7 deletions
-
weed/command/master.go
-
weed/command/server.go
-
weed/command/volume.go
|
@ -6,7 +6,6 @@ import ( |
|
|
"google.golang.org/grpc/reflection" |
|
|
"google.golang.org/grpc/reflection" |
|
|
"net/http" |
|
|
"net/http" |
|
|
"os" |
|
|
"os" |
|
|
"runtime" |
|
|
|
|
|
"sort" |
|
|
"sort" |
|
|
"strconv" |
|
|
"strconv" |
|
|
"strings" |
|
|
"strings" |
|
@ -86,7 +85,6 @@ func runMaster(cmd *Command, args []string) bool { |
|
|
util.LoadConfiguration("security", false) |
|
|
util.LoadConfiguration("security", false) |
|
|
util.LoadConfiguration("master", false) |
|
|
util.LoadConfiguration("master", false) |
|
|
|
|
|
|
|
|
runtime.GOMAXPROCS(runtime.NumCPU()) |
|
|
|
|
|
grace.SetupProfiling(*masterCpuProfile, *masterMemProfile) |
|
|
grace.SetupProfiling(*masterCpuProfile, *masterMemProfile) |
|
|
|
|
|
|
|
|
parent, _ := util.FullPath(*m.metaFolder).DirAndName() |
|
|
parent, _ := util.FullPath(*m.metaFolder).DirAndName() |
|
|
|
@ -3,7 +3,6 @@ package command |
|
|
import ( |
|
|
import ( |
|
|
"fmt" |
|
|
"fmt" |
|
|
"os" |
|
|
"os" |
|
|
"runtime" |
|
|
|
|
|
"runtime/pprof" |
|
|
"runtime/pprof" |
|
|
"strings" |
|
|
"strings" |
|
|
"time" |
|
|
"time" |
|
@ -192,7 +191,6 @@ func runServer(cmd *Command, args []string) bool { |
|
|
webdavOptions.filer = &filerAddress |
|
|
webdavOptions.filer = &filerAddress |
|
|
msgBrokerOptions.filer = &filerAddress |
|
|
msgBrokerOptions.filer = &filerAddress |
|
|
|
|
|
|
|
|
runtime.GOMAXPROCS(runtime.NumCPU()) |
|
|
|
|
|
go stats_collect.StartMetricsServer(*serverMetricsHttpPort) |
|
|
go stats_collect.StartMetricsServer(*serverMetricsHttpPort) |
|
|
|
|
|
|
|
|
folders := strings.Split(*volumeDataFolders, ",") |
|
|
folders := strings.Split(*volumeDataFolders, ",") |
|
|
|
@ -6,7 +6,6 @@ import ( |
|
|
"net/http" |
|
|
"net/http" |
|
|
httppprof "net/http/pprof" |
|
|
httppprof "net/http/pprof" |
|
|
"os" |
|
|
"os" |
|
|
"runtime" |
|
|
|
|
|
"runtime/pprof" |
|
|
"runtime/pprof" |
|
|
"strconv" |
|
|
"strconv" |
|
|
"strings" |
|
|
"strings" |
|
@ -111,8 +110,6 @@ func runVolume(cmd *Command, args []string) bool { |
|
|
|
|
|
|
|
|
util.LoadConfiguration("security", false) |
|
|
util.LoadConfiguration("security", false) |
|
|
|
|
|
|
|
|
runtime.GOMAXPROCS(runtime.NumCPU()) |
|
|
|
|
|
|
|
|
|
|
|
// If --pprof is set we assume the caller wants to be able to collect
|
|
|
// If --pprof is set we assume the caller wants to be able to collect
|
|
|
// cpu and memory profiles via go tool pprof
|
|
|
// cpu and memory profiles via go tool pprof
|
|
|
if !*v.pprof { |
|
|
if !*v.pprof { |
|
|