Splite cpu/memory info in OSUtils#isOverload (#12663)
This commit is contained in:
parent
aeb861fa15
commit
ff59acd02f
|
|
@ -477,10 +477,14 @@ public class OSUtils {
|
|||
double loadAverage = loadAverage();
|
||||
// system available physical memory
|
||||
double availablePhysicalMemorySize = availablePhysicalMemorySize();
|
||||
if (loadAverage > maxCpuLoadAvg || availablePhysicalMemorySize < reservedMemory) {
|
||||
if (loadAverage > maxCpuLoadAvg) {
|
||||
logger.warn("Current cpu load average {} is too high, max.cpuLoad.avg={}", loadAverage, maxCpuLoadAvg);
|
||||
return true;
|
||||
}
|
||||
|
||||
if (availablePhysicalMemorySize < reservedMemory) {
|
||||
logger.warn(
|
||||
"Current cpu load average {} is too high or available memory {}G is too low, under max.cpuLoad.avg={} and reserved.memory={}G",
|
||||
loadAverage, availablePhysicalMemorySize, maxCpuLoadAvg, reservedMemory);
|
||||
"Current available memory {}G is too low, reserved.memory={}G", maxCpuLoadAvg, reservedMemory);
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
|
|
|
|||
Loading…
Reference in New Issue