Skip to content

Commit

Permalink
change max_memory to float (#830)
Browse files Browse the repository at this point in the history
  • Loading branch information
frostbyte73 authored Dec 19, 2024
1 parent f8c92ae commit 79f4513
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion pkg/config/service.go
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ type ServiceConfig struct {

type CPUCostConfig struct {
MaxCpuUtilization float64 `yaml:"max_cpu_utilization"` // maximum allowed CPU utilization when deciding to accept a request. Default to 80%
MaxMemory int `yaml:"max_memory"` // maximum allowed memory usage in GB. 0 to disable
MaxMemory float64 `yaml:"max_memory"` // maximum allowed memory usage in GB. 0 to disable
MaxConcurrentWeb int32 `yaml:"max_concurrent_web"` // maximum allowed chrome/x/pulse instances
RoomCompositeCpuCost float64 `yaml:"room_composite_cpu_cost"`
AudioRoomCompositeCpuCost float64 `yaml:"audio_room_composite_cpu_cost"`
Expand Down
2 changes: 1 addition & 1 deletion pkg/stats/monitor.go
Original file line number Diff line number Diff line change
Expand Up @@ -446,7 +446,7 @@ func (m *Monitor) updateEgressStats(stats *hwstats.ProcStats) {
}
}

if m.cpuCostConfig.MaxMemory > 0 && totalMemory > m.cpuCostConfig.MaxMemory*gb {
if m.cpuCostConfig.MaxMemory > 0 && totalMemory > int(m.cpuCostConfig.MaxMemory*gb) {
logger.Warnw("high memory usage", nil,
"memory", float64(totalMemory)/gb,
"requests", m.requests.Load(),
Expand Down

0 comments on commit 79f4513

Please sign in to comment.