From 76b244cfcf95915514e739e5bd9d98028ee0987b Mon Sep 17 00:00:00 2001 From: Aliaksandr Valialkin Date: Tue, 29 Sep 2020 13:54:25 +0300 Subject: [PATCH] lib/cgroup: do not adjust the number of detected CPU cores via /sys/devices/system/cpu/online The adjustement increases the resulting GOMAXPROC by 1, which looks confusing to users as outlined at https://github.com/VictoriaMetrics/VictoriaMetrics/issues/685#issuecomment-698595309 --- lib/cgroup/cpu.go | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/lib/cgroup/cpu.go b/lib/cgroup/cpu.go index 6d112979d..fbfd73238 100644 --- a/lib/cgroup/cpu.go +++ b/lib/cgroup/cpu.go @@ -65,9 +65,7 @@ func getOnlineCPUCount() float64 { if n <= 0 { return -1 } - // Add a half of CPU core, since it looks like actual cores is usually bigger than online cores. - // See https://github.com/VictoriaMetrics/VictoriaMetrics/issues/685#issuecomment-674423728 - return n + 0.5 + return n } func countCPUs(data string) int {