mirror of
https://github.com/prometheus/prometheus.git
synced 2025-02-21 03:16:00 -08:00
cmd/prometheus: Undo GOGC adjustment
This commit is contained in:
parent
ece483c0c1
commit
757cba7c31
|
@ -20,7 +20,6 @@ import (
|
||||||
_ "net/http/pprof" // Comment this line to disable pprof endpoint.
|
_ "net/http/pprof" // Comment this line to disable pprof endpoint.
|
||||||
"os"
|
"os"
|
||||||
"os/signal"
|
"os/signal"
|
||||||
"runtime/debug"
|
|
||||||
"syscall"
|
"syscall"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
|
@ -42,13 +41,6 @@ func main() {
|
||||||
os.Exit(Main())
|
os.Exit(Main())
|
||||||
}
|
}
|
||||||
|
|
||||||
// defaultGCPercent is the value used to to call SetGCPercent if the GOGC
|
|
||||||
// environment variable is not set or empty. The value here is intended to hit
|
|
||||||
// the sweet spot between memory utilization and GC effort. It is lower than the
|
|
||||||
// usual default of 100 as a lot of the heap in Prometheus is used to cache
|
|
||||||
// memory chunks, which have a lifetime of hours if not days or weeks.
|
|
||||||
const defaultGCPercent = 40
|
|
||||||
|
|
||||||
var (
|
var (
|
||||||
configSuccess = prometheus.NewGauge(prometheus.GaugeOpts{
|
configSuccess = prometheus.NewGauge(prometheus.GaugeOpts{
|
||||||
Namespace: "prometheus",
|
Namespace: "prometheus",
|
||||||
|
@ -78,10 +70,6 @@ func Main() int {
|
||||||
return 0
|
return 0
|
||||||
}
|
}
|
||||||
|
|
||||||
if os.Getenv("GOGC") == "" {
|
|
||||||
debug.SetGCPercent(defaultGCPercent)
|
|
||||||
}
|
|
||||||
|
|
||||||
log.Infoln("Starting prometheus", version.Info())
|
log.Infoln("Starting prometheus", version.Info())
|
||||||
log.Infoln("Build context", version.BuildContext())
|
log.Infoln("Build context", version.BuildContext())
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue