Disable default node limits (#472)

* Disable default node limits

* removed unused vars
This commit is contained in:
David Zhao
2022-02-27 16:54:39 -08:00
committed by GitHub
parent c2d3e6e33e
commit 433a5cd8d1

View File

@@ -3,7 +3,6 @@ package config
import (
"fmt"
"os"
"runtime"
"time"
"github.com/mitchellh/go-homedir"
@@ -13,12 +12,6 @@ import (
"gopkg.in/yaml.v3"
)
const (
defaultLimitNumTracksPerCPU int32 = 400
defaultLimitMaxNumTracks int32 = 8000
defaultLimitBytesPerSec float32 = 1_000_000_000 // just under 10 Gbps
)
var DefaultStunServers = []string{
"stun.l.google.com:19302",
"stun1.l.google.com:19302",
@@ -225,7 +218,7 @@ func NewConfig(confString string, c *cli.Context) (*Config, error) {
},
NodeSelector: NodeSelectorConfig{
Kind: "random",
SysloadLimit: 0.7,
SysloadLimit: 0.9,
},
Keys: map[string]string{},
}
@@ -266,17 +259,6 @@ func NewConfig(confString string, c *cli.Context) (*Config, error) {
}
}
if conf.Limit.NumTracks == 0 {
conf.Limit.NumTracks = defaultLimitNumTracksPerCPU * int32(runtime.NumCPU())
if conf.Limit.NumTracks > defaultLimitMaxNumTracks {
conf.Limit.NumTracks = defaultLimitMaxNumTracks
}
}
if conf.Limit.BytesPerSec == 0 {
conf.Limit.BytesPerSec = defaultLimitBytesPerSec
}
if conf.LogLevel != "" {
conf.Logging.Level = conf.LogLevel
}