SLG_user_guide.html 16 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506
  1. <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
  2. <html>
  3. <head>
  4. <META http-equiv="Content-Type" content="text/html; charset=UTF-8">
  5. <meta content="Apache Forrest" name="Generator">
  6. <meta name="Forrest-version" content="0.8">
  7. <meta name="Forrest-skin-name" content="pelt">
  8. <title> HDFS Utilities: Synthetic Load Generator User Guide </title>
  9. <link type="text/css" href="skin/basic.css" rel="stylesheet">
  10. <link media="screen" type="text/css" href="skin/screen.css" rel="stylesheet">
  11. <link media="print" type="text/css" href="skin/print.css" rel="stylesheet">
  12. <link type="text/css" href="skin/profile.css" rel="stylesheet">
  13. <script src="skin/getBlank.js" language="javascript" type="text/javascript"></script><script src="skin/getMenu.js" language="javascript" type="text/javascript"></script><script src="skin/fontsize.js" language="javascript" type="text/javascript"></script>
  14. <link rel="shortcut icon" href="images/favicon.ico">
  15. </head>
  16. <body onload="init()">
  17. <script type="text/javascript">ndeSetTextSize();</script>
  18. <div id="top">
  19. <!--+
  20. |breadtrail
  21. +-->
  22. <div class="breadtrail">
  23. <a href="http://www.apache.org/">Apache</a> &gt; <a href="http://hadoop.apache.org/">Hadoop</a> &gt; <a href="http://hadoop.apache.org/core/">Core</a><script src="skin/breadcrumbs.js" language="JavaScript" type="text/javascript"></script>
  24. </div>
  25. <!--+
  26. |header
  27. +-->
  28. <div class="header">
  29. <!--+
  30. |start group logo
  31. +-->
  32. <div class="grouplogo">
  33. <a href="http://hadoop.apache.org/"><img class="logoImage" alt="Hadoop" src="images/hadoop-logo.jpg" title="Apache Hadoop"></a>
  34. </div>
  35. <!--+
  36. |end group logo
  37. +-->
  38. <!--+
  39. |start Project Logo
  40. +-->
  41. <div class="projectlogo">
  42. <a href="http://hadoop.apache.org/core/"><img class="logoImage" alt="Hadoop" src="images/core-logo.gif" title="Scalable Computing Platform"></a>
  43. </div>
  44. <!--+
  45. |end Project Logo
  46. +-->
  47. <!--+
  48. |start Search
  49. +-->
  50. <div class="searchbox">
  51. <form action="http://www.google.com/search" method="get" class="roundtopsmall">
  52. <input value="hadoop.apache.org" name="sitesearch" type="hidden"><input onFocus="getBlank (this, 'Search the site with google');" size="25" name="q" id="query" type="text" value="Search the site with google">&nbsp;
  53. <input name="Search" value="Search" type="submit">
  54. </form>
  55. </div>
  56. <!--+
  57. |end search
  58. +-->
  59. <!--+
  60. |start Tabs
  61. +-->
  62. <ul id="tabs">
  63. <li>
  64. <a class="unselected" href="http://hadoop.apache.org/core/">Project</a>
  65. </li>
  66. <li>
  67. <a class="unselected" href="http://wiki.apache.org/hadoop">Wiki</a>
  68. </li>
  69. <li class="current">
  70. <a class="selected" href="index.html">Hadoop 0.19 Documentation</a>
  71. </li>
  72. </ul>
  73. <!--+
  74. |end Tabs
  75. +-->
  76. </div>
  77. </div>
  78. <div id="main">
  79. <div id="publishedStrip">
  80. <!--+
  81. |start Subtabs
  82. +-->
  83. <div id="level2tabs"></div>
  84. <!--+
  85. |end Endtabs
  86. +-->
  87. <script type="text/javascript"><!--
  88. document.write("Last Published: " + document.lastModified);
  89. // --></script>
  90. </div>
  91. <!--+
  92. |breadtrail
  93. +-->
  94. <div class="breadtrail">
  95. &nbsp;
  96. </div>
  97. <!--+
  98. |start Menu, mainarea
  99. +-->
  100. <!--+
  101. |start Menu
  102. +-->
  103. <div id="menu">
  104. <div onclick="SwitchMenu('menu_selected_1.1', 'skin/')" id="menu_selected_1.1Title" class="menutitle" style="background-image: url('skin/images/chapter_open.gif');">Documentation</div>
  105. <div id="menu_selected_1.1" class="selectedmenuitemgroup" style="display: block;">
  106. <div class="menuitem">
  107. <a href="index.html">Overview</a>
  108. </div>
  109. <div class="menuitem">
  110. <a href="quickstart.html">Hadoop Quick Start</a>
  111. </div>
  112. <div class="menuitem">
  113. <a href="cluster_setup.html">Hadoop Cluster Setup</a>
  114. </div>
  115. <div class="menuitem">
  116. <a href="mapred_tutorial.html">Hadoop Map/Reduce Tutorial</a>
  117. </div>
  118. <div class="menuitem">
  119. <a href="commands_manual.html">Hadoop Command Guide</a>
  120. </div>
  121. <div class="menuitem">
  122. <a href="hdfs_shell.html">Hadoop FS Shell Guide</a>
  123. </div>
  124. <div class="menuitem">
  125. <a href="distcp.html">Hadoop DistCp Guide</a>
  126. </div>
  127. <div class="menuitem">
  128. <a href="native_libraries.html">Hadoop Native Libraries</a>
  129. </div>
  130. <div class="menuitem">
  131. <a href="streaming.html">Hadoop Streaming</a>
  132. </div>
  133. <div class="menuitem">
  134. <a href="hadoop_archives.html">Hadoop Archives</a>
  135. </div>
  136. <div class="menuitem">
  137. <a href="hdfs_user_guide.html">HDFS User Guide</a>
  138. </div>
  139. <div class="menuitem">
  140. <a href="hdfs_design.html">HDFS Architecture</a>
  141. </div>
  142. <div class="menuitem">
  143. <a href="hdfs_permissions_guide.html">HDFS Admin Guide: Permissions</a>
  144. </div>
  145. <div class="menuitem">
  146. <a href="hdfs_quota_admin_guide.html">HDFS Admin Guide: Quotas</a>
  147. </div>
  148. <div class="menupage">
  149. <div class="menupagetitle">HDFS Utilities</div>
  150. </div>
  151. <div class="menuitem">
  152. <a href="libhdfs.html">HDFS C API</a>
  153. </div>
  154. <div class="menuitem">
  155. <a href="hod_user_guide.html">HOD User Guide</a>
  156. </div>
  157. <div class="menuitem">
  158. <a href="hod_admin_guide.html">HOD Admin Guide</a>
  159. </div>
  160. <div class="menuitem">
  161. <a href="hod_config_guide.html">HOD Config Guide</a>
  162. </div>
  163. <div class="menuitem">
  164. <a href="capacity_scheduler.html">Capacity Scheduler</a>
  165. </div>
  166. <div class="menuitem">
  167. <a href="api/index.html">API Docs</a>
  168. </div>
  169. <div class="menuitem">
  170. <a href="jdiff/changes.html">API Changes</a>
  171. </div>
  172. <div class="menuitem">
  173. <a href="http://wiki.apache.org/hadoop/">Wiki</a>
  174. </div>
  175. <div class="menuitem">
  176. <a href="http://wiki.apache.org/hadoop/FAQ">FAQ</a>
  177. </div>
  178. <div class="menuitem">
  179. <a href="releasenotes.html">Release Notes</a>
  180. </div>
  181. <div class="menuitem">
  182. <a href="changes.html">Change Log</a>
  183. </div>
  184. </div>
  185. <div id="credit"></div>
  186. <div id="roundbottom">
  187. <img style="display: none" class="corner" height="15" width="15" alt="" src="skin/images/rc-b-l-15-1body-2menu-3menu.png"></div>
  188. <!--+
  189. |alternative credits
  190. +-->
  191. <div id="credit2"></div>
  192. </div>
  193. <!--+
  194. |end Menu
  195. +-->
  196. <!--+
  197. |start content
  198. +-->
  199. <div id="content">
  200. <div title="Portable Document Format" class="pdflink">
  201. <a class="dida" href="SLG_user_guide.pdf"><img alt="PDF -icon" src="skin/images/pdfdoc.gif" class="skin"><br>
  202. PDF</a>
  203. </div>
  204. <h1> HDFS Utilities: Synthetic Load Generator User Guide </h1>
  205. <div id="minitoc-area">
  206. <ul class="minitoc">
  207. <li>
  208. <a href="#Description"> Description </a>
  209. </li>
  210. <li>
  211. <a href="#Synopsis"> Synopsis </a>
  212. </li>
  213. <li>
  214. <a href="#Test+Space+Population"> Test Space Population </a>
  215. <ul class="minitoc">
  216. <li>
  217. <a href="#Structure+Generator"> Structure Generator </a>
  218. </li>
  219. <li>
  220. <a href="#Test+Space+Generator"> Test Space Generator </a>
  221. </li>
  222. </ul>
  223. </li>
  224. </ul>
  225. </div>
  226. <a name="N1000D"></a><a name="Description"></a>
  227. <h2 class="h3"> Description </h2>
  228. <div class="section">
  229. <p>
  230. The synthetic load generator is a tool for testing NameNode behavior
  231. under different client loads. The user can generate different mixes
  232. of read, write, and list requests by specifying the probabilities of
  233. read and write. The user controls the intensity of the load by adjusting
  234. parameters for the number of worker threads and the delay between
  235. operations. While load generators are running, the user can profile and
  236. monitor the running of the NameNode. When a load generator exits, it
  237. prints some NameNode statistics like the average execution time of each
  238. kind of operation and the NameNode throughput.
  239. </p>
  240. </div>
  241. <a name="N10017"></a><a name="Synopsis"></a>
  242. <h2 class="h3"> Synopsis </h2>
  243. <div class="section">
  244. <p>
  245. <span class="codefrag">java LoadGenerator [options]</span>
  246. <br>
  247. </p>
  248. <p>
  249. Options include:<br>
  250. <span class="codefrag">&nbsp;&nbsp;-readProbability &lt;read probability&gt;</span>
  251. <br>
  252. <span class="codefrag">&nbsp;&nbsp;&nbsp;&nbsp;the probability of the read operation;
  253. default is 0.3333. </span>
  254. <br>
  255. <span class="codefrag">&nbsp;&nbsp;-writeProbability &lt;write probability&gt;</span>
  256. <br>
  257. <span class="codefrag">&nbsp;&nbsp;&nbsp;&nbsp;the probability of the write
  258. operations; default is 0.3333.</span>
  259. <br>
  260. <span class="codefrag">&nbsp;&nbsp;-root &lt;test space root&gt;</span>
  261. <br>
  262. <span class="codefrag">&nbsp;&nbsp;&nbsp;&nbsp;the root of the test space;
  263. default is /testLoadSpace.</span>
  264. <br>
  265. <span class="codefrag">&nbsp;&nbsp;-maxDelayBetweenOps
  266. &lt;maxDelayBetweenOpsInMillis&gt;</span>
  267. <br>
  268. <span class="codefrag">&nbsp;&nbsp;&nbsp;&nbsp;the maximum delay between two consecutive
  269. operations in a thread; default is 0 indicating no delay.
  270. </span>
  271. <br>
  272. <span class="codefrag">&nbsp;&nbsp;-numOfThreads &lt;numOfThreads&gt;</span>
  273. <br>
  274. <span class="codefrag">&nbsp;&nbsp;&nbsp;&nbsp;the number of threads to spawn;
  275. default is 200.</span>
  276. <br>
  277. <span class="codefrag">&nbsp;&nbsp;-elapsedTime &lt;elapsedTimeInSecs&gt;</span>
  278. <br>
  279. <span class="codefrag">&nbsp;&nbsp;&nbsp;&nbsp;the number of seconds that the program
  280. will run; A value of zero indicates that the program runs
  281. forever. The default value is 0.</span>
  282. <br>
  283. <span class="codefrag">&nbsp;&nbsp;-startTime &lt;startTimeInMillis&gt;</span>
  284. <br>
  285. <span class="codefrag">&nbsp;&nbsp;&nbsp;&nbsp;the time that all worker threads
  286. start to run. By default it is 10 seconds after the main
  287. program starts running.This creates a barrier if more than
  288. one load generator is running.
  289. </span>
  290. <br>
  291. <span class="codefrag">&nbsp;&nbsp;-seed &lt;seed&gt;</span>
  292. <br>
  293. <span class="codefrag">&nbsp;&nbsp;&nbsp;&nbsp;the random generator seed for repeating
  294. requests to NameNode when running with a single thread;
  295. default is the current time.</span>
  296. <br>
  297. </p>
  298. <p>
  299. After command line argument parsing, the load generator traverses
  300. the test space and builds a table of all directories and another table
  301. of all files in the test space. It then waits until the start time to
  302. spawn the number of worker threads as specified by the user. Each
  303. thread sends a stream of requests to NameNode. At each iteration,
  304. it first decides if it is going to read a file, create a file, or
  305. list a directory following the read and write probabilities specified
  306. by the user. The listing probability is equal to
  307. <em>1-read probability-write probability</em>. When reading,
  308. it randomly picks a file in the test space and reads the entire file.
  309. When writing, it randomly picks a directory in the test space and
  310. creates a file there. To avoid two threads with the same load
  311. generator or from two different load generators create the same
  312. file, the file name consists of the current machine's host name
  313. and the thread id. The length of the file follows Gaussian
  314. distribution with an average size of 2 blocks and the standard
  315. deviation of 1. The new file is filled with byte 'a'. To avoid
  316. the test space to grow indefinitely, the file is deleted immediately
  317. after the file creation completes. While listing, it randomly
  318. picks a directory in the test space and lists its content.
  319. After an operation completes, the thread pauses for a random
  320. amount of time in the range of [0, maxDelayBetweenOps] if the
  321. specified maximum delay is not zero. All threads are stopped when
  322. the specified elapsed time is passed. Before exiting, the program
  323. prints the average execution for each kind of NameNode operations,
  324. and the number of requests served by the NameNode per second.
  325. </p>
  326. </div>
  327. <a name="N10070"></a><a name="Test+Space+Population"></a>
  328. <h2 class="h3"> Test Space Population </h2>
  329. <div class="section">
  330. <p>
  331. The user needs to populate a test space before she runs a
  332. load generator. The structure generator generates a random
  333. test space structure and the data generator creates the files
  334. and directories of the test space in Hadoop distributed file system.
  335. </p>
  336. <a name="N10079"></a><a name="Structure+Generator"></a>
  337. <h3 class="h4"> Structure Generator </h3>
  338. <p>
  339. This tool generates a random namespace structure with the
  340. following constraints:
  341. </p>
  342. <ol>
  343. <li>The number of subdirectories that a directory can have is
  344. a random number in [minWidth, maxWidth].</li>
  345. <li>The maximum depth of each subdirectory is a random number
  346. [2*maxDepth/3, maxDepth].</li>
  347. <li>Files are randomly placed in leaf directories. The size of
  348. each file follows Gaussian distribution with an average size
  349. of 1 block and a standard deviation of 1.</li>
  350. </ol>
  351. <p>
  352. The generated namespace structure is described by two files in
  353. the output directory. Each line of the first file contains the
  354. full name of a leaf directory. Each line of the second file
  355. contains the full name of a file and its size, separated by a blank.
  356. </p>
  357. <p>
  358. The synopsis of the command is
  359. </p>
  360. <p>
  361. <span class="codefrag">java StructureGenerator [options]</span>
  362. </p>
  363. <p>
  364. Options include:<br>
  365. <span class="codefrag">&nbsp;&nbsp;-maxDepth &lt;maxDepth&gt;</span>
  366. <br>
  367. <span class="codefrag">&nbsp;&nbsp;&nbsp;&nbsp;maximum depth of the directory tree;
  368. default is 5.</span>
  369. <br>
  370. <span class="codefrag">&nbsp;&nbsp;-minWidth &lt;minWidth&gt;</span>
  371. <br>
  372. <span class="codefrag">&nbsp;&nbsp;&nbsp;&nbsp;minimum number of subdirectories per
  373. directories; default is 1.</span>
  374. <br>
  375. <span class="codefrag">&nbsp;&nbsp;-maxWidth &lt;maxWidth&gt;</span>
  376. <br>
  377. <span class="codefrag">&nbsp;&nbsp;&nbsp;&nbsp;maximum number of subdirectories per
  378. directories; default is 5.</span>
  379. <br>
  380. <span class="codefrag">&nbsp;&nbsp;-numOfFiles &lt;#OfFiles&gt;</span>
  381. <br>
  382. <span class="codefrag">&nbsp;&nbsp;&nbsp;&nbsp;the total number of files in the test
  383. space; default is 10.</span>
  384. <br>
  385. <span class="codefrag">&nbsp;&nbsp;-avgFileSize &lt;avgFileSizeInBlocks&gt;</span>
  386. <br>
  387. <span class="codefrag">&nbsp;&nbsp;&nbsp;&nbsp;average size of blocks; default is 1.
  388. </span>
  389. <br>
  390. <span class="codefrag">&nbsp;&nbsp;-outDir &lt;outDir&gt;</span>
  391. <br>
  392. <span class="codefrag">&nbsp;&nbsp;&nbsp;&nbsp;output directory; default is the
  393. current directory. </span>
  394. <br>
  395. <span class="codefrag">&nbsp;&nbsp;-seed &lt;seed&gt;</span>
  396. <br>
  397. <span class="codefrag">&nbsp;&nbsp;&nbsp;&nbsp;random number generator seed;
  398. default is the current time.</span>
  399. <br>
  400. </p>
  401. <a name="N100D8"></a><a name="Test+Space+Generator"></a>
  402. <h3 class="h4"> Test Space Generator </h3>
  403. <p>
  404. This tool reads the directory structure and file structure from
  405. the input directory and creates the namespace in Hadoop distributed
  406. file system. All files are filled with byte 'a'.
  407. </p>
  408. <p>
  409. The synopsis of the command is
  410. </p>
  411. <p>
  412. <span class="codefrag">java DataGenerator [options]</span>
  413. </p>
  414. <p>
  415. Options include:<br>
  416. <span class="codefrag">&nbsp;&nbsp;-inDir &lt;inDir&gt;</span>
  417. <br>
  418. <span class="codefrag">&nbsp;&nbsp;&nbsp;&nbsp;input directory name where directory/file
  419. structures are stored; default is the current directory.
  420. </span>
  421. <br>
  422. <span class="codefrag">&nbsp;&nbsp;-root &lt;test space root&gt;</span>
  423. <br>
  424. <span class="codefrag">&nbsp;&nbsp;&nbsp;&nbsp;the name of the root directory which the
  425. new namespace is going to be placed under;
  426. default is "/testLoadSpace".</span>
  427. <br>
  428. </p>
  429. </div>
  430. </div>
  431. <!--+
  432. |end content
  433. +-->
  434. <div class="clearboth">&nbsp;</div>
  435. </div>
  436. <div id="footer">
  437. <!--+
  438. |start bottomstrip
  439. +-->
  440. <div class="lastmodified">
  441. <script type="text/javascript"><!--
  442. document.write("Last Published: " + document.lastModified);
  443. // --></script>
  444. </div>
  445. <div class="copyright">
  446. Copyright &copy;
  447. 2008 <a href="http://www.apache.org/licenses/">The Apache Software Foundation.</a>
  448. </div>
  449. <!--+
  450. |end bottomstrip
  451. +-->
  452. </div>
  453. </body>
  454. </html>