In this test, use NNThroughputBenchmark to create directories, the dirs parameter is always 10000, and dirsPerDir is 128. Cpu cores is 8.
set handler count to 2
<property>
<name>dfs.namenode.handler.count</name>
<value>2</value>
</property>
test with 2 threads, Elapsed Time: 102022
[houzhizhen@localhost hadoop]$ hadoop jar share/hadoop/hdfs/hadoop-hdfs-2.8.2-tests.jar org.apache.hadoop.hdfs.server.namenode.NNThroughputBenchmark -op mkdirs -threads 2 -dirs 10000 -dirsPerDir 128
17/11/13 11:45:10 INFO namenode.NNThroughputBenchmark: Starting benchmark: mkdirs
17/11/13 11:45:10 INFO namenode.NNThroughputBenchmark: Generate 10000 inputs for mkdirs
17/11/13 11:45:10 FATAL namenode.NNThroughputBenchmark: Log level = ERROR
17/11/13 11:45:10 INFO namenode.NNThroughputBenchmark: Starting 10000 mkdirs(s).
17/11/13 11:46:52 INFO namenode.NNThroughputBenchmark:
17/11/13 11:46:52 INFO namenode.NNThroughputBenchmark: --- mkdirs inputs ---
17/11/13 11:46:52 INFO namenode.NNThroughputBenchmark: nrDirs = 10000
17/11/13 11:46:52 INFO namenode.NNThroughputBenchmark: nrThreads = 2
17/11/13 11:46:52 INFO namenode.NNThroughputBenchmark: nrDirsPerDir = 128
17/11/13 11:46:52 INFO namenode.NNThroughputBenchmark: --- mkdirs stats ---
17/11/13 11:46:52 INFO namenode.NNThroughputBenchmark: # operations: 10000
17/11/13 11:46:52 INFO namenode.NNThroughputBenchmark: Elapsed Time: 102022
17/11/13 11:46:52 INFO namenode.NNThroughputBenchmark: Ops per sec: 98.01807453294387
17/11/13 11:46:52 INFO namenode.NNThroughputBenchmark: Average Time: 20
test with 20 threads, Elapsed Time: 102154
This indicates that increase the client threads will not result in the perfo