jinhyukify commented on code in PR #7076:
URL: https://github.com/apache/hbase/pull/7076#discussion_r2134585925


##########
hbase-common/src/main/java/org/apache/hadoop/hbase/HConstants.java:
##########
@@ -1040,10 +1040,21 @@ public enum OperationStatusCode {
   public static final String HFILE_PREAD_ALL_BYTES_ENABLED_KEY = 
"hfile.pread.all.bytes.enabled";
   public static final boolean HFILE_PREAD_ALL_BYTES_ENABLED_DEFAULT = false;
 
-  /*
-   * Minimum percentage of free heap necessary for a successful cluster 
startup.
+  /**
+   * Configuration key for the minimum fraction of heap memory that must 
remain free for a
+   * RegionServer to start
+   */
+  public static final String HBASE_REGION_SERVER_FREE_HEAP_MIN_SIZE_KEY =
+    "hbase.regionserver.free.heap.min.size";
+
+  public static final float HBASE_REGION_SERVER_FREE_HEAP_MIN_SIZE_DEFAULT = 
0.1f;
+
+  /**
+   * Configuration key for the absolute amount of heap memory that must remain 
free for a
+   * RegionServer to start
    */
-  public static final float HBASE_CLUSTER_MINIMUM_MEMORY_THRESHOLD = 0.2f;
+  public static final String HBASE_REGION_SERVER_FREE_HEAP_MEMORY_MIN_SIZE_KEY 
=
+    "hbase.regionserver.free.heap.memory.min.size";

Review Comment:
   Thanks for the detailed insights šŸ˜„ 
   
   > And that made me wonder whether the absolute version of 
hbase.regionserver.free.heap.min.size should be named 
hbase.regionserver.free.heap.min.memory.size to follow the same size vs 
memory.size convention. But maybe there was no such convention in the first 
place?
   
   You're right. There wasn't a clear convention initially, but following the 
existing blockCache configuration and using the `memory.size` suffix seems like 
a better approach.
   
   > So could you explain how you are going to use these parameters on your 
clusters?
   
   I was planning to use an absolute value for the heap size as well.
   The reason I first added the fraction-based version was because the original 
config was already managed as a fraction.
   
   But I agree with your point. Using an absolute size is not only more 
explicit for users, but also provides more stability.
   Unlike memStore or blockCache, where we're allocating memory, this one is 
about preserving a minimum free heap, so an absolute value feels more 
appropriate.
   
   
   If we go with absolute size only, we still need to think about the default 
value.
   I typically use at least 31GB heap per RegionServer, but for low-spec VMs 
(e.g. 4GB heap), something like `512m` might make more sense? To avoid startup 
issues in smaller clusters, I’m leaning toward a conservative default for now.
   I'm also considering allowing this value to be disabled (by setting it to 0) 
or overridden to something like 128m in 
[`conf/hbase-site.xml`](https://github.com/apache/hbase/blob/master/conf/hbase-site.xml),
 especially for test environments.
   Do you have any thoughts on this?



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscr...@hbase.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to