You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@dolphinscheduler.apache.org by ca...@apache.org on 2022/11/02 13:15:16 UTC

[dolphinscheduler] branch dev updated: Splite cpu/memory info in OSUtils#isOverload (#12663)

This is an automated email from the ASF dual-hosted git repository.

caishunfeng pushed a commit to branch dev
in repository https://gitbox.apache.org/repos/asf/dolphinscheduler.git


The following commit(s) were added to refs/heads/dev by this push:
     new ff59acd02f Splite cpu/memory info in OSUtils#isOverload (#12663)
ff59acd02f is described below

commit ff59acd02fe6f601a929963d3c5bfefa61e21387
Author: Wenjun Ruan <we...@apache.org>
AuthorDate: Wed Nov 2 21:15:03 2022 +0800

    Splite cpu/memory info in OSUtils#isOverload (#12663)
---
 .../java/org/apache/dolphinscheduler/common/utils/OSUtils.java | 10 +++++++---
 1 file changed, 7 insertions(+), 3 deletions(-)

diff --git a/dolphinscheduler-common/src/main/java/org/apache/dolphinscheduler/common/utils/OSUtils.java b/dolphinscheduler-common/src/main/java/org/apache/dolphinscheduler/common/utils/OSUtils.java
index 2ad403014b..59f9adbdec 100644
--- a/dolphinscheduler-common/src/main/java/org/apache/dolphinscheduler/common/utils/OSUtils.java
+++ b/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;