environment: allow overriding memory overhead; closes pterodactyl/panel#3728 (#111)

This commit is contained in:
Matthew Penner
2022-01-17 20:20:30 -07:00
committed by GitHub
parent ed4d903f21
commit 1892b270b1
2 changed files with 70 additions and 12 deletions

View File

@@ -75,13 +75,7 @@ func (l Limits) ConvertedCpuLimit() int64 {
// server is < 4G, use 10%, if less than 2G use 15%. This avoids unexpected
// crashes from processes like Java which run over the limit.
func (l Limits) MemoryOverheadMultiplier() float64 {
if l.MemoryLimit <= 2048 {
return 1.15
} else if l.MemoryLimit <= 4096 {
return 1.10
}
return 1.05
return config.Get().Docker.Overhead.GetMultiplier(l.MemoryLimit)
}
func (l Limits) BoundedMemoryLimit() int64 {