ソースを参照

HDFS-14820. The default 8KB buffer of BlockReaderRemote#newBlockReader#BufferedOutputStream is too big. Contributed by Lisheng Sun.

Wei-Chiu Chuang 5 年 前
コミット
7b637a3341

+ 1 - 1
hadoop-hdfs-project/hadoop-hdfs-client/src/main/java/org/apache/hadoop/hdfs/client/HdfsClientConfigKeys.java

@@ -150,7 +150,7 @@ public interface HdfsClientConfigKeys {
               TimeUnit.DAYS.toMillis(10); // 10 days
   String DFS_CLIENT_BLOCK_READER_REMOTE_BUFFER_SIZE_KEY =
       "dfs.client.block.reader.remote.buffer.size";
-  int DFS_CLIENT_BLOCK_READER_REMOTE_BUFFER_SIZE_DEFAULT = 8192;
+  int DFS_CLIENT_BLOCK_READER_REMOTE_BUFFER_SIZE_DEFAULT = 512;
 
   String DFS_CLIENT_DEAD_NODE_DETECTION_ENABLED_KEY =
           "dfs.client.deadnode.detection.enabled";

+ 2 - 4
hadoop-hdfs-project/hadoop-hdfs/src/main/resources/hdfs-default.xml

@@ -4305,13 +4305,11 @@
 
   <property>
     <name>dfs.client.block.reader.remote.buffer.size</name>
-    <value>8192</value>
+    <value>512</value>
     <description>
-      The output stream buffer size of a DFSClient remote read. The buffer default value is 8KB. The buffer includes
+      The output stream buffer size of a DFSClient remote read. The buffer default value is 512B. The buffer includes
       only some request parameters that are: block, blockToken, clientName, startOffset, len, verifyChecksum,
       cachingStrategy.
-      It is recommended to adjust the value according to the workload, which can reduce unnecessary memory
-      usage and the frequency of the garbage collection. A value of 512 might be reasonable.
     </description>
   </property>