SLG_user_guide.html 16 KB

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