From 570a83ae80faf2076966acf30588733803327844 Mon Sep 17 00:00:00 2001 From: Brandon Li Date: Tue, 24 Mar 2015 10:49:16 -0700 Subject: [PATCH] HDFS-7977. NFS couldn't take percentile intervals. Contributed by Brandon Li --- .../apache/hadoop/hdfs/nfs/conf/NfsConfigKeys.java | 1 - .../apache/hadoop/hdfs/nfs/nfs3/Nfs3Metrics.java | 13 ++++++------- hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt | 2 ++ .../hadoop-hdfs/src/site/markdown/HdfsNfsGateway.md | 12 ++++++++++++ 4 files changed, 20 insertions(+), 8 deletions(-) diff --git a/hadoop-hdfs-project/hadoop-hdfs-nfs/src/main/java/org/apache/hadoop/hdfs/nfs/conf/NfsConfigKeys.java b/hadoop-hdfs-project/hadoop-hdfs-nfs/src/main/java/org/apache/hadoop/hdfs/nfs/conf/NfsConfigKeys.java index 09ee579170..05cc0b5cf6 100644 --- a/hadoop-hdfs-project/hadoop-hdfs-nfs/src/main/java/org/apache/hadoop/hdfs/nfs/conf/NfsConfigKeys.java +++ b/hadoop-hdfs-project/hadoop-hdfs-nfs/src/main/java/org/apache/hadoop/hdfs/nfs/conf/NfsConfigKeys.java @@ -72,7 +72,6 @@ public class NfsConfigKeys { public static final String NFS_HTTPS_ADDRESS_DEFAULT = "0.0.0.0:" + NFS_HTTPS_PORT_DEFAULT; public static final String NFS_METRICS_PERCENTILES_INTERVALS_KEY = "nfs.metrics.percentiles.intervals"; - public static final String NFS_METRICS_PERCENTILES_INTERVALS_DEFAULT = ""; /* * HDFS super-user is the user with the same identity as NameNode process diff --git a/hadoop-hdfs-project/hadoop-hdfs-nfs/src/main/java/org/apache/hadoop/hdfs/nfs/nfs3/Nfs3Metrics.java b/hadoop-hdfs-project/hadoop-hdfs-nfs/src/main/java/org/apache/hadoop/hdfs/nfs/nfs3/Nfs3Metrics.java index d36ea732f0..880a8a6063 100644 --- a/hadoop-hdfs-project/hadoop-hdfs-nfs/src/main/java/org/apache/hadoop/hdfs/nfs/nfs3/Nfs3Metrics.java +++ b/hadoop-hdfs-project/hadoop-hdfs-nfs/src/main/java/org/apache/hadoop/hdfs/nfs/nfs3/Nfs3Metrics.java @@ -90,9 +90,9 @@ public Nfs3Metrics(String name, String sessionId, int[] intervals, readNanosQuantiles[i] = registry.newQuantiles("readProcessNanos" + interval + "s", "Read process in ns", "ops", "latency", interval); writeNanosQuantiles[i] = registry.newQuantiles("writeProcessNanos" - + interval + "s", " process in ns", "ops", "latency", interval); + + interval + "s", "Write process in ns", "ops", "latency", interval); commitNanosQuantiles[i] = registry.newQuantiles("commitProcessNanos" - + interval + "s", "Read process in ns", "ops", "latency", interval); + + interval + "s", "Commit process in ns", "ops", "latency", interval); } } @@ -101,10 +101,9 @@ public static Nfs3Metrics create(Configuration conf, String gatewayName) { MetricsSystem ms = DefaultMetricsSystem.instance(); JvmMetrics jm = JvmMetrics.create(gatewayName, sessionId, ms); - // Percentile measurement is [,,,] by default - int[] intervals = conf.getInts(conf.get( - NfsConfigKeys.NFS_METRICS_PERCENTILES_INTERVALS_KEY, - NfsConfigKeys.NFS_METRICS_PERCENTILES_INTERVALS_DEFAULT)); + // Percentile measurement is [50th,75th,90th,95th,99th] currently + int[] intervals = conf + .getInts(NfsConfigKeys.NFS_METRICS_PERCENTILES_INTERVALS_KEY); return ms.register(new Nfs3Metrics(gatewayName, sessionId, intervals, jm)); } @@ -217,4 +216,4 @@ public void addCommit(long latencyNanos) { } } -} \ No newline at end of file +} diff --git a/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt b/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt index 3725a035d3..5dae029f5a 100644 --- a/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt +++ b/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt @@ -1260,6 +1260,8 @@ Release 2.7.0 - UNRELEASED HDFS-7961. Trigger full block report after hot swapping disk. (Eddy Xu via wang) + HDFS-7977. NFS couldn't take percentile intervals (brandonli) + BREAKDOWN OF HDFS-7584 SUBTASKS AND RELATED JIRAS HDFS-7720. Quota by Storage Type API, tools and ClientNameNode diff --git a/hadoop-hdfs-project/hadoop-hdfs/src/site/markdown/HdfsNfsGateway.md b/hadoop-hdfs-project/hadoop-hdfs/src/site/markdown/HdfsNfsGateway.md index 9c95287fca..a49d1688b2 100644 --- a/hadoop-hdfs-project/hadoop-hdfs/src/site/markdown/HdfsNfsGateway.md +++ b/hadoop-hdfs-project/hadoop-hdfs/src/site/markdown/HdfsNfsGateway.md @@ -170,6 +170,18 @@ It's strongly recommended for the users to update a few configuration properties the_name_of_hdfs_superuser +* Metrics. Like other HDFS daemons, the gateway exposes runtime metrics. It is available at `http://gateway-ip:50079/jmx` as a JSON document. + The NFS handler related metrics is exposed under the name "Nfs3Metrics". The latency histograms can be enabled by adding the following + property to hdfs-site.xml file. + + + nfs.metrics.percentiles.intervals + 100 + Enable the latency histograms for read, write and + commit requests. The time unit is 100 seconds in this example. + + + * JVM and log settings. You can export JVM settings (e.g., heap size and GC log) in HADOOP\_NFS3\_OPTS. More NFS related settings can be found in hadoop-env.sh. To get NFS debug trace, you can edit the log4j.property file