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
This commit is contained in:
Aliaksandr Valialkin 2020-09-29 13:54:25 +03:00
parent f4d74ccfec
commit 5e998e597a

View File

@ -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 {