mirror of
https://github.com/VictoriaMetrics/VictoriaMetrics.git
synced 2024-11-21 14:44:00 +00:00
lib/cgroup: remove SetGOGC() function
GOGC can be already set via environment variable. There is no need in adding new approaches for setting the GOGC (such as command-line flag), since they complicate operations.
This commit is contained in:
parent
fce313ae7f
commit
de9a9546c2
2 changed files with 0 additions and 15 deletions
|
@ -11,7 +11,6 @@ import (
|
||||||
"github.com/VictoriaMetrics/VictoriaMetrics/app/vlselect"
|
"github.com/VictoriaMetrics/VictoriaMetrics/app/vlselect"
|
||||||
"github.com/VictoriaMetrics/VictoriaMetrics/app/vlstorage"
|
"github.com/VictoriaMetrics/VictoriaMetrics/app/vlstorage"
|
||||||
"github.com/VictoriaMetrics/VictoriaMetrics/lib/buildinfo"
|
"github.com/VictoriaMetrics/VictoriaMetrics/lib/buildinfo"
|
||||||
"github.com/VictoriaMetrics/VictoriaMetrics/lib/cgroup"
|
|
||||||
"github.com/VictoriaMetrics/VictoriaMetrics/lib/envflag"
|
"github.com/VictoriaMetrics/VictoriaMetrics/lib/envflag"
|
||||||
"github.com/VictoriaMetrics/VictoriaMetrics/lib/flagutil"
|
"github.com/VictoriaMetrics/VictoriaMetrics/lib/flagutil"
|
||||||
"github.com/VictoriaMetrics/VictoriaMetrics/lib/fs"
|
"github.com/VictoriaMetrics/VictoriaMetrics/lib/fs"
|
||||||
|
@ -26,7 +25,6 @@ var (
|
||||||
useProxyProtocol = flag.Bool("httpListenAddr.useProxyProtocol", false, "Whether to use proxy protocol for connections accepted at -httpListenAddr . "+
|
useProxyProtocol = flag.Bool("httpListenAddr.useProxyProtocol", false, "Whether to use proxy protocol for connections accepted at -httpListenAddr . "+
|
||||||
"See https://www.haproxy.org/download/1.8/doc/proxy-protocol.txt . "+
|
"See https://www.haproxy.org/download/1.8/doc/proxy-protocol.txt . "+
|
||||||
"With enabled proxy protocol http server cannot serve regular /metrics endpoint. Use -pushmetrics.url for metrics pushing")
|
"With enabled proxy protocol http server cannot serve regular /metrics endpoint. Use -pushmetrics.url for metrics pushing")
|
||||||
gogc = flag.Int("gogc", 100, "GOGC to use. See https://tip.golang.org/doc/gc-guide")
|
|
||||||
)
|
)
|
||||||
|
|
||||||
func main() {
|
func main() {
|
||||||
|
@ -34,7 +32,6 @@ func main() {
|
||||||
flag.CommandLine.SetOutput(os.Stdout)
|
flag.CommandLine.SetOutput(os.Stdout)
|
||||||
flag.Usage = usage
|
flag.Usage = usage
|
||||||
envflag.Parse()
|
envflag.Parse()
|
||||||
cgroup.SetGOGC(*gogc)
|
|
||||||
buildinfo.Init()
|
buildinfo.Init()
|
||||||
logger.Init()
|
logger.Init()
|
||||||
|
|
||||||
|
|
|
@ -34,18 +34,6 @@ func initGOGC() {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// SetGOGC sets GOGC to the given percent
|
|
||||||
func SetGOGC(percent int) {
|
|
||||||
if percent <= 0 {
|
|
||||||
return
|
|
||||||
}
|
|
||||||
if percent > 100 {
|
|
||||||
percent = 100
|
|
||||||
}
|
|
||||||
gogc = percent
|
|
||||||
debug.SetGCPercent(gogc)
|
|
||||||
}
|
|
||||||
|
|
||||||
var gogc int
|
var gogc int
|
||||||
|
|
||||||
// GetMemoryLimit returns cgroup memory limit
|
// GetMemoryLimit returns cgroup memory limit
|
||||||
|
|
Loading…
Reference in a new issue