Skip to content

Commit

Permalink
HDFS-17171. CONGESTION_RATIO should be configurable (#5996)
Browse files Browse the repository at this point in the history
Reviewed-by: Ayush Saxena <[email protected]>
Signed-off-by: Tao Li <[email protected]>
  • Loading branch information
hfutatzhanghb authored Oct 8, 2023
1 parent 42b32fb commit ea3cb12
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1573,6 +1573,8 @@ public class DFSConfigKeys extends CommonConfigurationKeys {
public static final boolean DFS_PIPELINE_ECN_ENABLED_DEFAULT = false;
public static final String DFS_PIPELINE_SLOWNODE_ENABLED = "dfs.pipeline.slownode";
public static final boolean DFS_PIPELINE_SLOWNODE_ENABLED_DEFAULT = false;
public static final String DFS_PIPELINE_CONGESTION_RATIO = "dfs.pipeline.congestion.ratio";
public static final double DFS_PIPELINE_CONGESTION_RATIO_DEFAULT = 1.5;

// Key Provider Cache Expiry
public static final String DFS_DATANODE_BLOCK_PINNING_ENABLED =
Expand Down Expand Up @@ -2042,5 +2044,4 @@ public class DFSConfigKeys extends CommonConfigurationKeys {
public static final long DFS_LEASE_HARDLIMIT_DEFAULT =
HdfsClientConfigKeys.DFS_LEASE_HARDLIMIT_DEFAULT;


}
Original file line number Diff line number Diff line change
Expand Up @@ -462,7 +462,7 @@ public static InetSocketAddress createSocketAddr(String target) {
private final Tracer tracer;
private static final int NUM_CORES = Runtime.getRuntime()
.availableProcessors();
private static final double CONGESTION_RATIO = 1.5;
private final double congestionRatio;
private DiskBalancer diskBalancer;
private DataSetLockManager dataSetLockManager;

Expand Down Expand Up @@ -515,6 +515,10 @@ private static Tracer createTracer(Configuration conf) {
volumeChecker = new DatasetVolumeChecker(conf, new Timer());
this.xferService =
HadoopExecutors.newCachedThreadPool(new Daemon.DaemonFactory());
double congestionRationTmp = conf.getDouble(DFSConfigKeys.DFS_PIPELINE_CONGESTION_RATIO,
DFSConfigKeys.DFS_PIPELINE_CONGESTION_RATIO_DEFAULT);
this.congestionRatio = congestionRationTmp > 0 ?
congestionRationTmp : DFSConfigKeys.DFS_PIPELINE_CONGESTION_RATIO_DEFAULT;
}

/**
Expand Down Expand Up @@ -614,6 +618,10 @@ public Map<String, Long> load(String key) {
new DataTransferThrottler(100, ecReconstuctReadBandwidth) : null;
this.ecReconstuctWriteThrottler = ecReconstuctWriteBandwidth > 0 ?
new DataTransferThrottler(100, ecReconstuctWriteBandwidth) : null;
double congestionRationTmp = conf.getDouble(DFSConfigKeys.DFS_PIPELINE_CONGESTION_RATIO,
DFSConfigKeys.DFS_PIPELINE_CONGESTION_RATIO_DEFAULT);
this.congestionRatio = congestionRationTmp > 0 ?
congestionRationTmp : DFSConfigKeys.DFS_PIPELINE_CONGESTION_RATIO_DEFAULT;
}

@Override // ReconfigurableBase
Expand Down Expand Up @@ -1070,7 +1078,7 @@ public PipelineAck.ECN getECN() {
}
double load = ManagementFactory.getOperatingSystemMXBean()
.getSystemLoadAverage();
return load > NUM_CORES * CONGESTION_RATIO ? PipelineAck.ECN.CONGESTED :
return load > NUM_CORES * congestionRatio ? PipelineAck.ECN.CONGESTED :
PipelineAck.ECN.SUPPORTED;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5619,6 +5619,14 @@
</description>
</property>

<property>
<name>dfs.pipeline.congestion.ratio</name>
<value>1.5</value>
<description>
The ratio which is used to compute congestion load.
</description>
</property>

<property>
<name>dfs.qjournal.accept-recovery.timeout.ms</name>
<value>120000</value>
Expand Down

0 comments on commit ea3cb12

Please sign in to comment.