SLG_user_guide.html 17 KB

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