Browse Source

Splite cpu/memory info in OSUtils#isOverload (#12663)

3.2.0-release
Wenjun Ruan 2 years ago committed by GitHub
parent
commit
ff59acd02f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 10
      dolphinscheduler-common/src/main/java/org/apache/dolphinscheduler/common/utils/OSUtils.java

10
dolphinscheduler-common/src/main/java/org/apache/dolphinscheduler/common/utils/OSUtils.java

@ -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…
Cancel
Save