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

technoboy pushed a commit to branch branch-3.1
in repository https://gitbox.apache.org/repos/asf/pulsar.git


The following commit(s) were added to refs/heads/branch-3.1 by this push:
     new 4139291d212 [improve] [broker] disable balancing based on 
DirectMemory. (#21168)
4139291d212 is described below

commit 4139291d21214b40a08884b0c487633c01c65ff8
Author: thetumbled <[email protected]>
AuthorDate: Thu Sep 14 10:44:06 2023 +0800

    [improve] [broker] disable balancing based on DirectMemory. (#21168)
---
 conf/broker.conf                                                     | 4 +++-
 .../src/main/java/org/apache/pulsar/broker/ServiceConfiguration.java | 5 +++--
 2 files changed, 6 insertions(+), 3 deletions(-)

diff --git a/conf/broker.conf b/conf/broker.conf
index 40eb1bcc324..4ad8536fd8d 100644
--- a/conf/broker.conf
+++ b/conf/broker.conf
@@ -1372,7 +1372,9 @@ loadBalancerCPUResourceWeight=1.0
 
 # The direct memory usage weight when calculating new resource usage.
 # It only takes effect in the ThresholdShedder strategy.
-loadBalancerDirectMemoryResourceWeight=1.0
+# Direct memory usage cannot accurately reflect the machine's load,
+# and it is not recommended to use it to score the machine's load.
+loadBalancerDirectMemoryResourceWeight=0
 
 # Bundle unload minimum throughput threshold (MB), avoiding bundle unload 
frequently.
 # It only takes effect in the ThresholdShedder strategy.
diff --git 
a/pulsar-broker-common/src/main/java/org/apache/pulsar/broker/ServiceConfiguration.java
 
b/pulsar-broker-common/src/main/java/org/apache/pulsar/broker/ServiceConfiguration.java
index 3d73734e827..fb267755913 100644
--- 
a/pulsar-broker-common/src/main/java/org/apache/pulsar/broker/ServiceConfiguration.java
+++ 
b/pulsar-broker-common/src/main/java/org/apache/pulsar/broker/ServiceConfiguration.java
@@ -2425,9 +2425,10 @@ public class ServiceConfiguration implements 
PulsarConfiguration {
     @FieldContext(
             dynamic = true,
             category = CATEGORY_LOAD_BALANCER,
-            doc = "Direct Memory Resource Usage Weight"
+            doc = "Direct Memory Resource Usage Weight. Direct memory usage 
cannot accurately reflect the "
+                    + "machine's load, and it is not recommended to use it to 
score the machine's load."
     )
-    private double loadBalancerDirectMemoryResourceWeight = 1.0;
+    private double loadBalancerDirectMemoryResourceWeight = 0;
 
     @FieldContext(
             dynamic = true,

Reply via email to