SLG_user_guide.html 16 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503
  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.20 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="hod_user_guide.html">HOD User Guide</a>
  153. </div>
  154. <div class="menuitem">
  155. <a href="hod_admin_guide.html">HOD Admin Guide</a>
  156. </div>
  157. <div class="menuitem">
  158. <a href="hod_config_guide.html">HOD Config Guide</a>
  159. </div>
  160. <div class="menuitem">
  161. <a href="capacity_scheduler.html">Capacity Scheduler</a>
  162. </div>
  163. <div class="menuitem">
  164. <a href="api/index.html">API Docs</a>
  165. </div>
  166. <div class="menuitem">
  167. <a href="jdiff/changes.html">API Changes</a>
  168. </div>
  169. <div class="menuitem">
  170. <a href="http://wiki.apache.org/hadoop/">Wiki</a>
  171. </div>
  172. <div class="menuitem">
  173. <a href="http://wiki.apache.org/hadoop/FAQ">FAQ</a>
  174. </div>
  175. <div class="menuitem">
  176. <a href="releasenotes.html">Release Notes</a>
  177. </div>
  178. <div class="menuitem">
  179. <a href="changes.html">Change Log</a>
  180. </div>
  181. </div>
  182. <div id="credit"></div>
  183. <div id="roundbottom">
  184. <img style="display: none" class="corner" height="15" width="15" alt="" src="skin/images/rc-b-l-15-1body-2menu-3menu.png"></div>
  185. <!--+
  186. |alternative credits
  187. +-->
  188. <div id="credit2"></div>
  189. </div>
  190. <!--+
  191. |end Menu
  192. +-->
  193. <!--+
  194. |start content
  195. +-->
  196. <div id="content">
  197. <div title="Portable Document Format" class="pdflink">
  198. <a class="dida" href="SLG_user_guide.pdf"><img alt="PDF -icon" src="skin/images/pdfdoc.gif" class="skin"><br>
  199. PDF</a>
  200. </div>
  201. <h1> HDFS Utilities: Synthetic Load Generator User Guide </h1>
  202. <div id="minitoc-area">
  203. <ul class="minitoc">
  204. <li>
  205. <a href="#Description"> Description </a>
  206. </li>
  207. <li>
  208. <a href="#Synopsis"> Synopsis </a>
  209. </li>
  210. <li>
  211. <a href="#Test+Space+Population"> Test Space Population </a>
  212. <ul class="minitoc">
  213. <li>
  214. <a href="#Structure+Generator"> Structure Generator </a>
  215. </li>
  216. <li>
  217. <a href="#Test+Space+Generator"> Test Space Generator </a>
  218. </li>
  219. </ul>
  220. </li>
  221. </ul>
  222. </div>
  223. <a name="N1000D"></a><a name="Description"></a>
  224. <h2 class="h3"> Description </h2>
  225. <div class="section">
  226. <p>
  227. The synthetic load generator is a tool for testing NameNode behavior
  228. under different client loads. The user can generate different mixes
  229. of read, write, and list requests by specifying the probabilities of
  230. read and write. The user controls the intensity of the load by adjusting
  231. parameters for the number of worker threads and the delay between
  232. operations. While load generators are running, the user can profile and
  233. monitor the running of the NameNode. When a load generator exits, it
  234. prints some NameNode statistics like the average execution time of each
  235. kind of operation and the NameNode throughput.
  236. </p>
  237. </div>
  238. <a name="N10017"></a><a name="Synopsis"></a>
  239. <h2 class="h3"> Synopsis </h2>
  240. <div class="section">
  241. <p>
  242. <span class="codefrag">java LoadGenerator [options]</span>
  243. <br>
  244. </p>
  245. <p>
  246. Options include:<br>
  247. <span class="codefrag">&nbsp;&nbsp;-readProbability &lt;read probability&gt;</span>
  248. <br>
  249. <span class="codefrag">&nbsp;&nbsp;&nbsp;&nbsp;the probability of the read operation;
  250. default is 0.3333. </span>
  251. <br>
  252. <span class="codefrag">&nbsp;&nbsp;-writeProbability &lt;write probability&gt;</span>
  253. <br>
  254. <span class="codefrag">&nbsp;&nbsp;&nbsp;&nbsp;the probability of the write
  255. operations; default is 0.3333.</span>
  256. <br>
  257. <span class="codefrag">&nbsp;&nbsp;-root &lt;test space root&gt;</span>
  258. <br>
  259. <span class="codefrag">&nbsp;&nbsp;&nbsp;&nbsp;the root of the test space;
  260. default is /testLoadSpace.</span>
  261. <br>
  262. <span class="codefrag">&nbsp;&nbsp;-maxDelayBetweenOps
  263. &lt;maxDelayBetweenOpsInMillis&gt;</span>
  264. <br>
  265. <span class="codefrag">&nbsp;&nbsp;&nbsp;&nbsp;the maximum delay between two consecutive
  266. operations in a thread; default is 0 indicating no delay.
  267. </span>
  268. <br>
  269. <span class="codefrag">&nbsp;&nbsp;-numOfThreads &lt;numOfThreads&gt;</span>
  270. <br>
  271. <span class="codefrag">&nbsp;&nbsp;&nbsp;&nbsp;the number of threads to spawn;
  272. default is 200.</span>
  273. <br>
  274. <span class="codefrag">&nbsp;&nbsp;-elapsedTime &lt;elapsedTimeInSecs&gt;</span>
  275. <br>
  276. <span class="codefrag">&nbsp;&nbsp;&nbsp;&nbsp;the number of seconds that the program
  277. will run; A value of zero indicates that the program runs
  278. forever. The default value is 0.</span>
  279. <br>
  280. <span class="codefrag">&nbsp;&nbsp;-startTime &lt;startTimeInMillis&gt;</span>
  281. <br>
  282. <span class="codefrag">&nbsp;&nbsp;&nbsp;&nbsp;the time that all worker threads
  283. start to run. By default it is 10 seconds after the main
  284. program starts running.This creates a barrier if more than
  285. one load generator is running.
  286. </span>
  287. <br>
  288. <span class="codefrag">&nbsp;&nbsp;-seed &lt;seed&gt;</span>
  289. <br>
  290. <span class="codefrag">&nbsp;&nbsp;&nbsp;&nbsp;the random generator seed for repeating
  291. requests to NameNode when running with a single thread;
  292. default is the current time.</span>
  293. <br>
  294. </p>
  295. <p>
  296. After command line argument parsing, the load generator traverses
  297. the test space and builds a table of all directories and another table
  298. of all files in the test space. It then waits until the start time to
  299. spawn the number of worker threads as specified by the user. Each
  300. thread sends a stream of requests to NameNode. At each iteration,
  301. it first decides if it is going to read a file, create a file, or
  302. list a directory following the read and write probabilities specified
  303. by the user. The listing probability is equal to
  304. <em>1-read probability-write probability</em>. When reading,
  305. it randomly picks a file in the test space and reads the entire file.
  306. When writing, it randomly picks a directory in the test space and
  307. creates a file there. To avoid two threads with the same load
  308. generator or from two different load generators create the same
  309. file, the file name consists of the current machine's host name
  310. and the thread id. The length of the file follows Gaussian
  311. distribution with an average size of 2 blocks and the standard
  312. deviation of 1. The new file is filled with byte 'a'. To avoid
  313. the test space to grow indefinitely, the file is deleted immediately
  314. after the file creation completes. While listing, it randomly
  315. picks a directory in the test space and lists its content.
  316. After an operation completes, the thread pauses for a random
  317. amount of time in the range of [0, maxDelayBetweenOps] if the
  318. specified maximum delay is not zero. All threads are stopped when
  319. the specified elapsed time is passed. Before exiting, the program
  320. prints the average execution for each kind of NameNode operations,
  321. and the number of requests served by the NameNode per second.
  322. </p>
  323. </div>
  324. <a name="N10070"></a><a name="Test+Space+Population"></a>
  325. <h2 class="h3"> Test Space Population </h2>
  326. <div class="section">
  327. <p>
  328. The user needs to populate a test space before she runs a
  329. load generator. The structure generator generates a random
  330. test space structure and the data generator creates the files
  331. and directories of the test space in Hadoop distributed file system.
  332. </p>
  333. <a name="N10079"></a><a name="Structure+Generator"></a>
  334. <h3 class="h4"> Structure Generator </h3>
  335. <p>
  336. This tool generates a random namespace structure with the
  337. following constraints:
  338. </p>
  339. <ol>
  340. <li>The number of subdirectories that a directory can have is
  341. a random number in [minWidth, maxWidth].</li>
  342. <li>The maximum depth of each subdirectory is a random number
  343. [2*maxDepth/3, maxDepth].</li>
  344. <li>Files are randomly placed in leaf directories. The size of
  345. each file follows Gaussian distribution with an average size
  346. of 1 block and a standard deviation of 1.</li>
  347. </ol>
  348. <p>
  349. The generated namespace structure is described by two files in
  350. the output directory. Each line of the first file contains the
  351. full name of a leaf directory. Each line of the second file
  352. contains the full name of a file and its size, separated by a blank.
  353. </p>
  354. <p>
  355. The synopsis of the command is
  356. </p>
  357. <p>
  358. <span class="codefrag">java StructureGenerator [options]</span>
  359. </p>
  360. <p>
  361. Options include:<br>
  362. <span class="codefrag">&nbsp;&nbsp;-maxDepth &lt;maxDepth&gt;</span>
  363. <br>
  364. <span class="codefrag">&nbsp;&nbsp;&nbsp;&nbsp;maximum depth of the directory tree;
  365. default is 5.</span>
  366. <br>
  367. <span class="codefrag">&nbsp;&nbsp;-minWidth &lt;minWidth&gt;</span>
  368. <br>
  369. <span class="codefrag">&nbsp;&nbsp;&nbsp;&nbsp;minimum number of subdirectories per
  370. directories; default is 1.</span>
  371. <br>
  372. <span class="codefrag">&nbsp;&nbsp;-maxWidth &lt;maxWidth&gt;</span>
  373. <br>
  374. <span class="codefrag">&nbsp;&nbsp;&nbsp;&nbsp;maximum number of subdirectories per
  375. directories; default is 5.</span>
  376. <br>
  377. <span class="codefrag">&nbsp;&nbsp;-numOfFiles &lt;#OfFiles&gt;</span>
  378. <br>
  379. <span class="codefrag">&nbsp;&nbsp;&nbsp;&nbsp;the total number of files in the test
  380. space; default is 10.</span>
  381. <br>
  382. <span class="codefrag">&nbsp;&nbsp;-avgFileSize &lt;avgFileSizeInBlocks&gt;</span>
  383. <br>
  384. <span class="codefrag">&nbsp;&nbsp;&nbsp;&nbsp;average size of blocks; default is 1.
  385. </span>
  386. <br>
  387. <span class="codefrag">&nbsp;&nbsp;-outDir &lt;outDir&gt;</span>
  388. <br>
  389. <span class="codefrag">&nbsp;&nbsp;&nbsp;&nbsp;output directory; default is the
  390. current directory. </span>
  391. <br>
  392. <span class="codefrag">&nbsp;&nbsp;-seed &lt;seed&gt;</span>
  393. <br>
  394. <span class="codefrag">&nbsp;&nbsp;&nbsp;&nbsp;random number generator seed;
  395. default is the current time.</span>
  396. <br>
  397. </p>
  398. <a name="N100D8"></a><a name="Test+Space+Generator"></a>
  399. <h3 class="h4"> Test Space Generator </h3>
  400. <p>
  401. This tool reads the directory structure and file structure from
  402. the input directory and creates the namespace in Hadoop distributed
  403. file system. All files are filled with byte 'a'.
  404. </p>
  405. <p>
  406. The synopsis of the command is
  407. </p>
  408. <p>
  409. <span class="codefrag">java DataGenerator [options]</span>
  410. </p>
  411. <p>
  412. Options include:<br>
  413. <span class="codefrag">&nbsp;&nbsp;-inDir &lt;inDir&gt;</span>
  414. <br>
  415. <span class="codefrag">&nbsp;&nbsp;&nbsp;&nbsp;input directory name where directory/file
  416. structures are stored; default is the current directory.
  417. </span>
  418. <br>
  419. <span class="codefrag">&nbsp;&nbsp;-root &lt;test space root&gt;</span>
  420. <br>
  421. <span class="codefrag">&nbsp;&nbsp;&nbsp;&nbsp;the name of the root directory which the
  422. new namespace is going to be placed under;
  423. default is "/testLoadSpace".</span>
  424. <br>
  425. </p>
  426. </div>
  427. </div>
  428. <!--+
  429. |end content
  430. +-->
  431. <div class="clearboth">&nbsp;</div>
  432. </div>
  433. <div id="footer">
  434. <!--+
  435. |start bottomstrip
  436. +-->
  437. <div class="lastmodified">
  438. <script type="text/javascript"><!--
  439. document.write("Last Published: " + document.lastModified);
  440. // --></script>
  441. </div>
  442. <div class="copyright">
  443. Copyright &copy;
  444. 2008 <a href="http://www.apache.org/licenses/">The Apache Software Foundation.</a>
  445. </div>
  446. <!--+
  447. |end bottomstrip
  448. +-->
  449. </div>
  450. </body>
  451. </html>