vaidya.html 17 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475
  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>Hadoop Vaidya: A Performance Diagnostic Tool for Map-Reduce Jobs</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="menuitem">
  149. <a href="SLG_user_guide.html">HDFS Utilities</a>
  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="menupage">
  167. <div class="menupagetitle">Hadoop Vaidya</div>
  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="vaidya.pdf"><img alt="PDF -icon" src="skin/images/pdfdoc.gif" class="skin"><br>
  205. PDF</a>
  206. </div>
  207. <h1>Hadoop Vaidya: A Performance Diagnostic Tool for Map-Reduce Jobs</h1>
  208. <div id="minitoc-area">
  209. <ul class="minitoc">
  210. <li>
  211. <a href="#Purpose">Purpose</a>
  212. </li>
  213. <li>
  214. <a href="#Pre-requisites">Pre-requisites</a>
  215. </li>
  216. <li>
  217. <a href="#Overview">Overview</a>
  218. </li>
  219. <li>
  220. <a href="#Terminology">Terminology</a>
  221. </li>
  222. <li>
  223. <a href="#How+to+Execute+the+Hadoop+Vaidya+Tool">How to Execute the Hadoop Vaidya Tool</a>
  224. </li>
  225. <li>
  226. <a href="#How+to+Write+and+Execute+your+own+Tests">How to Write and Execute your own Tests</a>
  227. </li>
  228. </ul>
  229. </div>
  230. <a name="N1000D"></a><a name="Purpose"></a>
  231. <h2 class="h3">Purpose</h2>
  232. <div class="section">
  233. <p>This document describes various user-facing facets of the Hadoop Vaidya tool. It
  234. describes both, how to execute a default set of rules against your Map-Reduce job counters,
  235. as well as how to write and execute new rules to detect specific performance problems.
  236. </p>
  237. <p>At present few sample test rules are provided with the tool with the objective of growing the rules database over the time.
  238. You are welcome to contribute the new rules for everyone's benefit and for that follow the similar
  239. <a href="http://wiki.apache.org/hadoop/HowToContribute">procedure</a>
  240. specified on Apache Hadoop website.
  241. </p>
  242. </div>
  243. <a name="N1001E"></a><a name="Pre-requisites"></a>
  244. <h2 class="h3">Pre-requisites</h2>
  245. <div class="section">
  246. <p>Ensure that Hadoop is installed and configured. More details:</p>
  247. <ul>
  248. <li>
  249. Make sure HADOOP_HOME environment variable is set.
  250. </li>
  251. <li>
  252. Make sure Java is installed and configured as a part of the Hadoop installation.
  253. </li>
  254. </ul>
  255. </div>
  256. <a name="N10031"></a><a name="Overview"></a>
  257. <h2 class="h3">Overview</h2>
  258. <div class="section">
  259. <p>Hadoop Vaidya (Vaidya in Sanskrit language means "one who knows", or "a physician")
  260. is a rule based performance diagnostic tool for
  261. Map/Reduce jobs. It performs a post execution analysis of map/reduce
  262. job by parsing and collecting execution statistics through job history
  263. and job configuration files. It runs a set of predefined tests/rules
  264. against job execution statistics to diagnose various performance problems.
  265. Each test rule detects a specific performance problem with the Map/Reduce job and provides
  266. a targeted advice to the user. This tool generates an XML report based on
  267. the evaluation results of individual test rules.
  268. </p>
  269. </div>
  270. <a name="N1003B"></a><a name="Terminology"></a>
  271. <h2 class="h3">Terminology</h2>
  272. <div class="section">
  273. <p> This section describes main concepts and terminology involved with Hadoop Vaidya,</p>
  274. <ul>
  275. <li>
  276. <em>PostExPerformanceDiagnoser</em>: This class extends the base Diagnoser class and acts as a driver for post execution performance analysis of Map/Reduce Jobs.
  277. It detects performance inefficiencies by executing a set of performance diagnosis rules against the job execution statistics.</li>
  278. <li>
  279. <em>Job Statistics</em>: This includes the job configuration information (job.xml) and various counters logged by Map/Reduce job as a part of the job history log
  280. file. The counters are parsed and collected into the Job Statistics data structures, which contains global job level aggregate counters and
  281. a set of counters for each Map and Reduce task.</li>
  282. <li>
  283. <em>Diagnostic Test/Rule</em>: This is a program logic that detects the inefficiency of M/R job based on the job statistics. The
  284. description of the Test is specified as an XML element (DiagnosticTest) in a test description file e.g.
  285. default tests description file, <em>$HADOOP_HOME/contrib/vaidya/conf/postex_diagnosis_tests.xml</em>. The actual logic is coded as
  286. a java class and referenced in the DiagnosticTest XML element. </li>
  287. </ul>
  288. <p></p>
  289. <p>Following section describes the <em>DiagnosticTest</em> XML element in a diagnostic test description file </p>
  290. <ul>
  291. <li>
  292. <em>DiagnosticTest{Title}</em>: Specifies a short name/description of the test.</li>
  293. <li>
  294. <em>DiagnosticTest{ClassName}</em>: Specifies fully qualified class name that implements the test logic.</li>
  295. <li>
  296. <em>DiagnosticTest{Description}</em>: Specifies a full description of the test rule.</li>
  297. <li>
  298. <em>DiagnosticTest{Importance}</em>: Specifies a declarative value for overall importance of the test rule. (Values: High, Medium, Low)</li>
  299. <li>
  300. <em>DiagnosticTest{SuccessThreshod}</em>: This is a threshold value specified by test case writer such that if impact level of the test case
  301. is lesser, then test is declared as PASSED (or NEGATIVE). The impact level is calculated and returned
  302. by individual test's evaluate function, specifying the degree of problem job has with respect to the condition being evaluated.</li>
  303. <li>
  304. <em>DiagnosticTest{Prescription}</em>: This is a targeted advice written by the test case adviser for the user to follow when test is not PASSED. </li>
  305. <li>
  306. <em>DiagonsticTest{InputElement}</em>: This is a test specific input that test writer has to optionally provide. This will be supplied to individual test case
  307. class so that test writer can use it within test case. This is typically a test configuration information such that test writer need not change the
  308. Java code for test case but rather can configure the test case using these input values. </li>
  309. </ul>
  310. <p></p>
  311. <p>Following section describes the performance analysis report generated by the tool in XML format</p>
  312. <ul>
  313. <li>
  314. <em>PostExPerformanceDiagnosticReport</em>: This is a document (root) element from the XML report generated by the tool. </li>
  315. <li>
  316. <em>TestReportElement</em>: This is a XML report element from the test report document, one for each individual test specified in test description
  317. file </li>
  318. <li>
  319. <em>TestReportElement{TestTitle}</em>: Will be included from DiagnosticTest{Title} </li>
  320. <li>
  321. <em>TestReportElement{TestDescription}</em>: Will be included from DiagnosticTest{Description} </li>
  322. <li>
  323. <em>TestReportElement{TestImportance}</em>: Will be included from DiagnosticTest{Importance} </li>
  324. <li>
  325. <em>TestReportElement{TestSeverity}</em>: This is a product of Test Impact level and Test Importance. It indicates overall severity of the test.</li>
  326. <li>
  327. <em>TestReportElement{ReferenceDetails}</em>: This is a test specific runtime information provided by test case to support the test result and severity. Typically
  328. Test writer should print the test impact level in this section. </li>
  329. <li>
  330. <em>TestReportElement{TestResults}</em>: This is boolean outcome of the test based on the SuccessThreshold specified by test writer in the DiagnosticTest description. The
  331. test PASSED(NEGATIVE) indicates no problem vs. FAILED (POSITIVE) indicates a potential problem with the job for given test case. </li>
  332. <li>
  333. <em>TestReportElement{TestPrescription}</em>: This will be included from DiagnosticTest{Prescription}, unless test case writer overrides it in the test case class through getPrescription()
  334. method </li>
  335. </ul>
  336. </div>
  337. <a name="N100D0"></a><a name="How+to+Execute+the+Hadoop+Vaidya+Tool"></a>
  338. <h2 class="h3">How to Execute the Hadoop Vaidya Tool</h2>
  339. <div class="section">
  340. <p>Script to execute Hadoop Vaidya is in <span class="codefrag">$HADOOP_HOME/contrib/vaidya/bin/</span> directory.
  341. It comes with a default set of rules defined in file:
  342. <span class="codefrag">$HADOOP_HOME/contrib/vaidya/conf/postex_diagnosis_tests.xml</span>
  343. </p>
  344. <ul>
  345. <li>Make sure HADOOP_HOME environment variable is set and Java is installed and configured.</li>
  346. <li>Execute the Hadoop Vaidya script with -help (or without any arguments) to get the command line help. e.g.
  347. <span class="codefrag">=&gt;sh $HADOOP_HOME/contrib/vaidya/bin/vaidya.sh -help</span>
  348. </li>
  349. <li>User needs to
  350. supply job's configuration file (<span class="codefrag">-jobconf job_conf.xml</span>), job history log file (<span class="codefrag">-joblog job_history_log_file</span>), and optionally the test description
  351. file (<span class="codefrag">-testconf postex_diagonostic_tests.xml</span>). If test description file is not specified then the default one is picked up from the Hadoop Vaidya Jar (<span class="codefrag">$HADOOP_HOME/contrib/vaidya/hadoop-{version}-vaidya.jar</span>).
  352. This default test description file is also available at following location for users to make a local copy, modify and add new test rules:
  353. <span class="codefrag">$HADOOP_HOME/contrib/vaidya/conf/postex_diagnostic_tests.xml</span>
  354. </li>
  355. <li> Use <span class="codefrag">-report report_file</span> option to store the xml report into specified report_file. </li>
  356. </ul>
  357. </div>
  358. <a name="N10102"></a><a name="How+to+Write+and+Execute+your+own+Tests"></a>
  359. <h2 class="h3">How to Write and Execute your own Tests</h2>
  360. <div class="section">
  361. <p>Writing and executing your own test rules is not very hard. You can take a look at Hadoop Vaidya source code for existing set of tests.
  362. The source code is at this <a href="http://svn.apache.org/viewvc/hadoop/core/trunk/src/contrib/vaidya/src/java/org/apache/hadoop/vaidya/">hadoop svn repository location</a>
  363. . The default set of tests are under <span class="codefrag">"postexdiagnosis/tests/"</span> folder.</p>
  364. <ul>
  365. <li>Writing a test class for your new test case should extend the <span class="codefrag">org.apache.hadoop.vaidya.DiagnosticTest</span> class and
  366. it should override following three methods from the base class,
  367. <ul>
  368. <li> evaluate() </li>
  369. <li> getPrescription() </li>
  370. <li> getReferenceDetails() </li>
  371. </ul>
  372. </li>
  373. <li>Make a local copy of the <span class="codefrag">$HADOOP_HOME/contrib/vaidya/conf/postex_diagnostic_tests.xml</span> file or create a new test description XML file.</li>
  374. <li>Add the test description element for your new test case to this test description file.</li>
  375. <li>Compile your new test class (or multiple classes), archive them into a Jar file and add it to the CLASSPATH e.g. (<span class="codefrag">export CLASSPATH=$CLASSPATH:newtests.jar</span>)</li>
  376. <li>Execute the Hadoop Vaidya script with the job configuration, job history log and reference to newly created test description file using <em>--testconf</em> option.
  377. <span class="codefrag">=&gt;sh $HADOOP_HOME/contrib/vaidya/bin/vaidya.sh -joblog job_history_log_file -jobconf job.xml -testconf new_test_description_file -report report.xml</span>
  378. </li>
  379. </ul>
  380. </div>
  381. <p>
  382. </p>
  383. <p>
  384. </p>
  385. <p>
  386. <em>Java and JNI are trademarks or registered trademarks of
  387. Sun Microsystems, Inc. in the United States and other countries.</em>
  388. </p>
  389. </div>
  390. <!--+
  391. |end content
  392. +-->
  393. <div class="clearboth">&nbsp;</div>
  394. </div>
  395. <div id="footer">
  396. <!--+
  397. |start bottomstrip
  398. +-->
  399. <div class="lastmodified">
  400. <script type="text/javascript"><!--
  401. document.write("Last Published: " + document.lastModified);
  402. // --></script>
  403. </div>
  404. <div class="copyright">
  405. Copyright &copy;
  406. 2008 <a href="http://www.apache.org/licenses/">The Apache Software Foundation.</a>
  407. </div>
  408. <!--+
  409. |end bottomstrip
  410. +-->
  411. </div>
  412. </body>
  413. </html>