mirror of
https://github.com/VictoriaMetrics/VictoriaMetrics.git
synced 2024-11-21 14:44:00 +00:00
lib/cgroup: add SetGOGC() function
This function is going to be used by VictoriaLogs
This commit is contained in:
parent
c1bed35b39
commit
3409317a67
1 changed files with 12 additions and 0 deletions
|
@ -34,6 +34,18 @@ 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
|
||||
|
||||
// GetMemoryLimit returns cgroup memory limit
|
||||
|
|
Loading…
Reference in a new issue