This page is to discuss benchmarking Hadoop using tools it provides.
NNThroughputBenchmark, as its name indicates, is a name-node throughput benchmark, which runs a series of client threads on a single node against a name-node. If no name-node is configured, it will firstly start a name-node in the same process (standalone mode), in which case each client repetitively performs the same operation by directly calling the respective name-node methods. Otherwise, the benchmark will perform the operations against a remote name-node via client protocol RPCs (remote mode). Either way, all clients are running locally in a single process rather than remotely across different nodes. The reason is to avoid communication overhead caused by RPC connections and serialization, and thus reveal the upper bound of pure name-node performance.
The benchmark first generates inputs for each thread so that the input generation overhead does not effect the resulting statistics. The number of operations performed by threads is practically the same. Precisely, the difference between the number of operations performed by any two threads does not exceed 1. Then the benchmark executes the specified number of operations using the specified number of threads and outputs the resulting stats by measuring the number of operations performed by the name-node per second.
The general command line syntax is:
hadoop org.apache.hadoop.hdfs.server.namenode.NNThroughputBenchmark [genericOptions] [commandOptions]
This benchmark honors the Hadoop command-line Generic Options to alter its behavior. The benchmark, as other tools, will rely on the
fs.defaultFS config, which is overridable by
-fs command option, to run standalone mode or remote mode. If the
fs.defaultFS scheme is not specified or is
file (local), the benchmark will run in standalone mode. Specially, the remote name-node config
dfs.namenode.fs-limits.min-block-size should be set as 16 while in standalone mode the benchmark turns off minimum block size verification for its internal name-node.
The following are all supported command options:
|Specify the operation. This option must be provided and should be the first option.|
|Specify the logging level when the benchmark runs. The default logging level is ERROR.|
|After every specified number of operations, the benchmark purges the name-node's user group cache. By default the refresh is never called.|
|If specified, do not clean up the name-space after execution. By default the name-space will be removed after test.|
Following are all the operations supported along with their respective operation-specific parameters (all optional) and default values.
|options for other operations|
When running benchmarks with the above operation(s), please provide operation-specific parameters illustrated as following.
|Number of total threads to run the respective operation.|
|Number of total files for the respective operation.|
|Number of total directories for the respective operation.|
|Number of files per directory.|
|Close the files after creation.|
|Number of directories per directory.|
|If specified, do not recreate the name-space, use existing data.|
|Total number of simulated data-nodes.|
|Total number of block reports to send.|
|Number of blocks per report.|
|Number of blocks per file.|
|Total number of simulated data-nodes to decommission.|
|The maximum number of outgoing replication streams for a data-node.|
|Number of total blocks to operate.|
|Replication factor. Will be adjusted to number of data-nodes if it is larger than that.|
The benchmark measures the number of operations performed by the name-node per second. Specifically, for each operation tested, it reports the total running time in seconds (Elapsed Time), operation throughput (Ops per sec), and average time for the operations (Average Time). The higher, the better.
Following is a sample reports by running following commands that opens 100K files with 1K threads against a remote name-node. See HDFS scalability: the limits to growth for real-world benchmark stats.
$ hadoop org.apache.hadoop.hdfs.server.namenode.NNThroughputBenchmark -fs hdfs://nameservice:9000 -op open -threads 1000 -files 100000 --- open inputs --- nrFiles = 100000 nrThreads = 1000 nrFilesPerDir = 4 --- open stats --- # operations: 100000 Elapsed Time: 9510 Ops per sec: 10515.247108307045 Average Time: 90