|
|
@ -477,10 +477,14 @@ public class OSUtils { |
|
|
|
double loadAverage = loadAverage(); |
|
|
|
double loadAverage = loadAverage(); |
|
|
|
// system available physical memory
|
|
|
|
// system available physical memory
|
|
|
|
double availablePhysicalMemorySize = availablePhysicalMemorySize(); |
|
|
|
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( |
|
|
|
logger.warn( |
|
|
|
"Current cpu load average {} is too high or available memory {}G is too low, under max.cpuLoad.avg={} and reserved.memory={}G", |
|
|
|
"Current available memory {}G is too low, reserved.memory={}G", maxCpuLoadAvg, reservedMemory); |
|
|
|
loadAverage, availablePhysicalMemorySize, maxCpuLoadAvg, reservedMemory); |
|
|
|
|
|
|
|
return true; |
|
|
|
return true; |
|
|
|
} |
|
|
|
} |
|
|
|
return false; |
|
|
|
return false; |
|
|
|