SLG_user_guide.html 16 KB

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