server_status_variables.lib.php 29 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765
  1. <?php
  2. /* vim: set expandtab sw=4 ts=4 sts=4: */
  3. /**
  4. * functions for displaying server status variables
  5. *
  6. * @usedby server_status_variables.php
  7. *
  8. * @package PhpMyAdmin
  9. */
  10. if (! defined('PHPMYADMIN')) {
  11. exit;
  12. }
  13. /**
  14. * Returns the html for the list filter
  15. *
  16. * @param PMA_ServerStatusData $ServerStatusData Server status data
  17. *
  18. * @return string
  19. */
  20. function PMA_getHtmlForFilter($ServerStatusData)
  21. {
  22. $filterAlert = '';
  23. if (! empty($_REQUEST['filterAlert'])) {
  24. $filterAlert = ' checked="checked"';
  25. }
  26. $filterText = '';
  27. if (! empty($_REQUEST['filterText'])) {
  28. $filterText = htmlspecialchars($_REQUEST['filterText']);
  29. }
  30. $dontFormat = '';
  31. if (! empty($_REQUEST['dontFormat'])) {
  32. $dontFormat = ' checked="checked"';
  33. }
  34. $retval = '';
  35. $retval .= '<fieldset id="tableFilter">';
  36. $retval .= '<legend>' . __('Filters') . '</legend>';
  37. $retval .= '<form action="server_status_variables.php?'
  38. . PMA_URL_getCommon() . '">';
  39. $retval .= '<input type="submit" value="' . __('Refresh') . '" />';
  40. $retval .= '<div class="formelement">';
  41. $retval .= '<label for="filterText">' . __('Containing the word:') . '</label>';
  42. $retval .= '<input name="filterText" type="text" id="filterText" '
  43. . 'style="vertical-align: baseline;" value="' . $filterText . '" />';
  44. $retval .= '</div>';
  45. $retval .= '<div class="formelement">';
  46. $retval .= '<input' . $filterAlert . ' type="checkbox" '
  47. . 'name="filterAlert" id="filterAlert" />';
  48. $retval .= '<label for="filterAlert">';
  49. $retval .= __('Show only alert values');
  50. $retval .= '</label>';
  51. $retval .= '</div>';
  52. $retval .= '<div class="formelement">';
  53. $retval .= '<select id="filterCategory" name="filterCategory">';
  54. $retval .= '<option value="">' . __('Filter by category…') . '</option>';
  55. foreach ($ServerStatusData->sections as $section_id => $section_name) {
  56. if (isset($ServerStatusData->categoryUsed[$section_id])) {
  57. if (! empty($_REQUEST['filterCategory'])
  58. && $_REQUEST['filterCategory'] == $section_id
  59. ) {
  60. $selected = ' selected="selected"';
  61. } else {
  62. $selected = '';
  63. }
  64. $retval .= '<option' . $selected . ' value="' . $section_id . '">';
  65. $retval .= htmlspecialchars($section_name) . '</option>';
  66. }
  67. }
  68. $retval .= '</select>';
  69. $retval .= '</div>';
  70. $retval .= '<div class="formelement">';
  71. $retval .= '<input' . $dontFormat . ' type="checkbox" '
  72. . 'name="dontFormat" id="dontFormat" />';
  73. $retval .= '<label for="dontFormat">';
  74. $retval .= __('Show unformatted values');
  75. $retval .= '</label>';
  76. $retval .= '</div>';
  77. $retval .= '</form>';
  78. $retval .= '</fieldset>';
  79. return $retval;
  80. }
  81. /**
  82. * Prints the suggestion links
  83. *
  84. * @param PMA_ServerStatusData $ServerStatusData Server status data
  85. *
  86. * @return string
  87. */
  88. function PMA_getHtmlForLinkSuggestions($ServerStatusData)
  89. {
  90. $retval = '<div id="linkSuggestions" class="defaultLinks" '
  91. . 'style="display:none">';
  92. $retval .= '<p class="notice">' . __('Related links:');
  93. foreach ($ServerStatusData->links as $section_name => $section_links) {
  94. $retval .= '<span class="status_' . $section_name . '"> ';
  95. $i=0;
  96. foreach ($section_links as $link_name => $link_url) {
  97. if ($i > 0) {
  98. $retval .= ', ';
  99. }
  100. if ('doc' == $link_name) {
  101. $retval .= PMA_Util::showMySQLDocu($link_url);
  102. } else {
  103. $retval .= '<a href="' . $link_url . '">' . $link_name . '</a>';
  104. }
  105. $i++;
  106. }
  107. $retval .= '</span>';
  108. }
  109. unset($link_url, $link_name, $i);
  110. $retval .= '</p>';
  111. $retval .= '</div>';
  112. return $retval;
  113. }
  114. /**
  115. * Returns a table with variables information
  116. *
  117. * @param PMA_ServerStatusData $ServerStatusData Server status data
  118. *
  119. * @return string
  120. */
  121. function PMA_getHtmlForVariablesList($ServerStatusData)
  122. {
  123. $retval = '';
  124. $strShowStatus = PMA_getStatusVariablesDescriptions();
  125. /**
  126. * define some alerts
  127. */
  128. // name => max value before alert
  129. $alerts = array(
  130. // lower is better
  131. // variable => max value
  132. 'Aborted_clients' => 0,
  133. 'Aborted_connects' => 0,
  134. 'Binlog_cache_disk_use' => 0,
  135. 'Created_tmp_disk_tables' => 0,
  136. 'Handler_read_rnd' => 0,
  137. 'Handler_read_rnd_next' => 0,
  138. 'Innodb_buffer_pool_pages_dirty' => 0,
  139. 'Innodb_buffer_pool_reads' => 0,
  140. 'Innodb_buffer_pool_wait_free' => 0,
  141. 'Innodb_log_waits' => 0,
  142. 'Innodb_row_lock_time_avg' => 10, // ms
  143. 'Innodb_row_lock_time_max' => 50, // ms
  144. 'Innodb_row_lock_waits' => 0,
  145. 'Slow_queries' => 0,
  146. 'Delayed_errors' => 0,
  147. 'Select_full_join' => 0,
  148. 'Select_range_check' => 0,
  149. 'Sort_merge_passes' => 0,
  150. 'Opened_tables' => 0,
  151. 'Table_locks_waited' => 0,
  152. 'Qcache_lowmem_prunes' => 0,
  153. 'Qcache_free_blocks' =>
  154. isset($ServerStatusData->status['Qcache_total_blocks'])
  155. ? $ServerStatusData->status['Qcache_total_blocks'] / 5
  156. : 0,
  157. 'Slow_launch_threads' => 0,
  158. // depends on Key_read_requests
  159. // normaly lower then 1:0.01
  160. 'Key_reads' => isset($ServerStatusData->status['Key_read_requests'])
  161. ? (0.01 * $ServerStatusData->status['Key_read_requests']) : 0,
  162. // depends on Key_write_requests
  163. // normaly nearly 1:1
  164. 'Key_writes' => isset($ServerStatusData->status['Key_write_requests'])
  165. ? (0.9 * $ServerStatusData->status['Key_write_requests']) : 0,
  166. 'Key_buffer_fraction' => 0.5,
  167. // alert if more than 95% of thread cache is in use
  168. 'Threads_cached' => isset($ServerStatusData->variables['thread_cache_size'])
  169. ? 0.95 * $ServerStatusData->variables['thread_cache_size'] : 0
  170. // higher is better
  171. // variable => min value
  172. //'Handler read key' => '> ',
  173. );
  174. $retval .= PMA_getHtmlForRenderVariables(
  175. $ServerStatusData,
  176. $alerts,
  177. $strShowStatus
  178. );
  179. return $retval;
  180. }
  181. /**
  182. * Returns HTML for render variables list
  183. *
  184. * @param PMA_ServerStatusData $ServerStatusData Server status data
  185. * @param Array $alerts Alert Array
  186. * @param Array $strShowStatus Status Array
  187. *
  188. * @return string
  189. */
  190. function PMA_getHtmlForRenderVariables($ServerStatusData, $alerts, $strShowStatus)
  191. {
  192. $retval = '<table class="data sortable noclick" id="serverstatusvariables">';
  193. $retval .= '<col class="namecol" />';
  194. $retval .= '<col class="valuecol" />';
  195. $retval .= '<col class="descrcol" />';
  196. $retval .= '<thead>';
  197. $retval .= '<tr>';
  198. $retval .= '<th>' . __('Variable') . '</th>';
  199. $retval .= '<th>' . __('Value') . '</th>';
  200. $retval .= '<th>' . __('Description') . '</th>';
  201. $retval .= '</tr>';
  202. $retval .= '</thead>';
  203. $retval .= '<tbody>';
  204. $odd_row = false;
  205. foreach ($ServerStatusData->status as $name => $value) {
  206. $odd_row = !$odd_row;
  207. $retval .= '<tr class="' . ($odd_row ? 'odd' : 'even')
  208. . (isset($ServerStatusData->allocationMap[$name])
  209. ?' s_' . $ServerStatusData->allocationMap[$name]
  210. : '')
  211. . '">';
  212. $retval .= '<th class="name">';
  213. $retval .= htmlspecialchars(str_replace('_', ' ', $name));
  214. // Fields containing % are calculated,
  215. // they can not be described in MySQL documentation
  216. if (strpos($name, '%') === false) {
  217. $retval .= PMA_Util::showMySQLDocu(
  218. 'server-status-variables',
  219. false,
  220. 'statvar_' . $name
  221. );
  222. }
  223. $retval .= '</th>';
  224. $retval .= '<td class="value"><span class="formatted">';
  225. if (isset($alerts[$name])) {
  226. if ($value > $alerts[$name]) {
  227. $retval .= '<span class="attention">';
  228. } else {
  229. $retval .= '<span class="allfine">';
  230. }
  231. }
  232. if ('%' === substr($name, -1, 1)) {
  233. $retval .= htmlspecialchars(PMA_Util::formatNumber($value, 0, 2)) . ' %';
  234. } elseif (strpos($name, 'Uptime') !== false) {
  235. $retval .= htmlspecialchars(
  236. PMA_Util::timespanFormat($value)
  237. );
  238. } elseif (is_numeric($value) && $value > 1000) {
  239. $retval .= '<abbr title="'
  240. // makes available the raw value as a title
  241. . htmlspecialchars(PMA_Util::formatNumber($value, 0))
  242. . '">'
  243. . htmlspecialchars(PMA_Util::formatNumber($value, 3, 1))
  244. . '</abbr>';
  245. } elseif (is_numeric($value)) {
  246. $retval .= htmlspecialchars(PMA_Util::formatNumber($value, 3, 1));
  247. } else {
  248. $retval .= htmlspecialchars($value);
  249. }
  250. if (isset($alerts[$name])) {
  251. $retval .= '</span>';
  252. }
  253. $retval .= '</span>';
  254. $retval .= '<span style="display:none;" class="original">';
  255. if (isset($alerts[$name])) {
  256. if ($value > $alerts[$name]) {
  257. $retval .= '<span class="attention">';
  258. } else {
  259. $retval .= '<span class="allfine">';
  260. }
  261. }
  262. $retval .= $value;
  263. if (isset($alerts[$name])) {
  264. $retval .= '</span>';
  265. }
  266. $retval .= '</span>';
  267. $retval .= '</td>';
  268. $retval .= '<td class="descr">';
  269. if (isset($strShowStatus[$name])) {
  270. $retval .= $strShowStatus[$name];
  271. }
  272. if (isset($ServerStatusData->links[$name])) {
  273. foreach ($ServerStatusData->links[$name] as $link_name => $link_url) {
  274. if ('doc' == $link_name) {
  275. $retval .= PMA_Util::showMySQLDocu($link_url);
  276. } else {
  277. $retval .= ' <a href="' . $link_url . '">' . $link_name . '</a>';
  278. }
  279. }
  280. unset($link_url, $link_name);
  281. }
  282. $retval .= '</td>';
  283. $retval .= '</tr>';
  284. }
  285. $retval .= '</tbody>';
  286. $retval .= '</table>';
  287. return $retval;
  288. }
  289. /**
  290. * Returns a list of variable descriptions
  291. *
  292. * @return array
  293. */
  294. function PMA_getStatusVariablesDescriptions()
  295. {
  296. /**
  297. * Messages are built using the message name
  298. */
  299. return array(
  300. 'Aborted_clients' => __(
  301. 'The number of connections that were aborted because the client died'
  302. . ' without closing the connection properly.'
  303. ),
  304. 'Aborted_connects' => __(
  305. 'The number of failed attempts to connect to the MySQL server.'
  306. ),
  307. 'Binlog_cache_disk_use' => __(
  308. 'The number of transactions that used the temporary binary log cache'
  309. . ' but that exceeded the value of binlog_cache_size and used a'
  310. . ' temporary file to store statements from the transaction.'
  311. ),
  312. 'Binlog_cache_use' => __(
  313. 'The number of transactions that used the temporary binary log cache.'
  314. ),
  315. 'Connections' => __(
  316. 'The number of connection attempts (successful or not)'
  317. . ' to the MySQL server.'
  318. ),
  319. 'Created_tmp_disk_tables' => __(
  320. 'The number of temporary tables on disk created automatically by'
  321. . ' the server while executing statements. If'
  322. . ' Created_tmp_disk_tables is big, you may want to increase the'
  323. . ' tmp_table_size value to cause temporary tables to be'
  324. . ' memory-based instead of disk-based.'
  325. ),
  326. 'Created_tmp_files' => __(
  327. 'How many temporary files mysqld has created.'
  328. ),
  329. 'Created_tmp_tables' => __(
  330. 'The number of in-memory temporary tables created automatically'
  331. . ' by the server while executing statements.'
  332. ),
  333. 'Delayed_errors' => __(
  334. 'The number of rows written with INSERT DELAYED for which some'
  335. . ' error occurred (probably duplicate key).'
  336. ),
  337. 'Delayed_insert_threads' => __(
  338. 'The number of INSERT DELAYED handler threads in use. Every'
  339. . ' different table on which one uses INSERT DELAYED gets'
  340. . ' its own thread.'
  341. ),
  342. 'Delayed_writes' => __(
  343. 'The number of INSERT DELAYED rows written.'
  344. ),
  345. 'Flush_commands' => __(
  346. 'The number of executed FLUSH statements.'
  347. ),
  348. 'Handler_commit' => __(
  349. 'The number of internal COMMIT statements.'
  350. ),
  351. 'Handler_delete' => __(
  352. 'The number of times a row was deleted from a table.'
  353. ),
  354. 'Handler_discover' => __(
  355. 'The MySQL server can ask the NDB Cluster storage engine if it'
  356. . ' knows about a table with a given name. This is called discovery.'
  357. . ' Handler_discover indicates the number of time tables have been'
  358. . ' discovered.'
  359. ),
  360. 'Handler_read_first' => __(
  361. 'The number of times the first entry was read from an index. If this'
  362. . ' is high, it suggests that the server is doing a lot of full'
  363. . ' index scans; for example, SELECT col1 FROM foo, assuming that'
  364. . ' col1 is indexed.'
  365. ),
  366. 'Handler_read_key' => __(
  367. 'The number of requests to read a row based on a key. If this is'
  368. . ' high, it is a good indication that your queries and tables'
  369. . ' are properly indexed.'
  370. ),
  371. 'Handler_read_next' => __(
  372. 'The number of requests to read the next row in key order. This is'
  373. . ' incremented if you are querying an index column with a range'
  374. . ' constraint or if you are doing an index scan.'
  375. ),
  376. 'Handler_read_prev' => __(
  377. 'The number of requests to read the previous row in key order.'
  378. . ' This read method is mainly used to optimize ORDER BY … DESC.'
  379. ),
  380. 'Handler_read_rnd' => __(
  381. 'The number of requests to read a row based on a fixed position.'
  382. . ' This is high if you are doing a lot of queries that require'
  383. . ' sorting of the result. You probably have a lot of queries that'
  384. . ' require MySQL to scan whole tables or you have joins that'
  385. . ' don\'t use keys properly.'
  386. ),
  387. 'Handler_read_rnd_next' => __(
  388. 'The number of requests to read the next row in the data file.'
  389. . ' This is high if you are doing a lot of table scans. Generally'
  390. . ' this suggests that your tables are not properly indexed or that'
  391. . ' your queries are not written to take advantage of the indexes'
  392. . ' you have.'
  393. ),
  394. 'Handler_rollback' => __(
  395. 'The number of internal ROLLBACK statements.'
  396. ),
  397. 'Handler_update' => __(
  398. 'The number of requests to update a row in a table.'
  399. ),
  400. 'Handler_write' => __(
  401. 'The number of requests to insert a row in a table.'
  402. ),
  403. 'Innodb_buffer_pool_pages_data' => __(
  404. 'The number of pages containing data (dirty or clean).'
  405. ),
  406. 'Innodb_buffer_pool_pages_dirty' => __(
  407. 'The number of pages currently dirty.'
  408. ),
  409. 'Innodb_buffer_pool_pages_flushed' => __(
  410. 'The number of buffer pool pages that have been requested'
  411. . ' to be flushed.'
  412. ),
  413. 'Innodb_buffer_pool_pages_free' => __(
  414. 'The number of free pages.'
  415. ),
  416. 'Innodb_buffer_pool_pages_latched' => __(
  417. 'The number of latched pages in InnoDB buffer pool. These are pages'
  418. . ' currently being read or written or that can\'t be flushed or'
  419. . ' removed for some other reason.'
  420. ),
  421. 'Innodb_buffer_pool_pages_misc' => __(
  422. 'The number of pages busy because they have been allocated for'
  423. . ' administrative overhead such as row locks or the adaptive'
  424. . ' hash index. This value can also be calculated as'
  425. . ' Innodb_buffer_pool_pages_total - Innodb_buffer_pool_pages_free'
  426. . ' - Innodb_buffer_pool_pages_data.'
  427. ),
  428. 'Innodb_buffer_pool_pages_total' => __(
  429. 'Total size of buffer pool, in pages.'
  430. ),
  431. 'Innodb_buffer_pool_read_ahead_rnd' => __(
  432. 'The number of "random" read-aheads InnoDB initiated. This happens'
  433. . ' when a query is to scan a large portion of a table but in'
  434. . ' random order.'
  435. ),
  436. 'Innodb_buffer_pool_read_ahead_seq' => __(
  437. 'The number of sequential read-aheads InnoDB initiated. This'
  438. . ' happens when InnoDB does a sequential full table scan.'
  439. ),
  440. 'Innodb_buffer_pool_read_requests' => __(
  441. 'The number of logical read requests InnoDB has done.'
  442. ),
  443. 'Innodb_buffer_pool_reads' => __(
  444. 'The number of logical reads that InnoDB could not satisfy'
  445. . ' from buffer pool and had to do a single-page read.'
  446. ),
  447. 'Innodb_buffer_pool_wait_free' => __(
  448. 'Normally, writes to the InnoDB buffer pool happen in the'
  449. . ' background. However, if it\'s necessary to read or create a page'
  450. . ' and no clean pages are available, it\'s necessary to wait for'
  451. . ' pages to be flushed first. This counter counts instances of'
  452. . ' these waits. If the buffer pool size was set properly, this'
  453. . ' value should be small.'
  454. ),
  455. 'Innodb_buffer_pool_write_requests' => __(
  456. 'The number writes done to the InnoDB buffer pool.'
  457. ),
  458. 'Innodb_data_fsyncs' => __(
  459. 'The number of fsync() operations so far.'
  460. ),
  461. 'Innodb_data_pending_fsyncs' => __(
  462. 'The current number of pending fsync() operations.'
  463. ),
  464. 'Innodb_data_pending_reads' => __(
  465. 'The current number of pending reads.'
  466. ),
  467. 'Innodb_data_pending_writes' => __(
  468. 'The current number of pending writes.'
  469. ),
  470. 'Innodb_data_read' => __(
  471. 'The amount of data read so far, in bytes.'
  472. ),
  473. 'Innodb_data_reads' => __(
  474. 'The total number of data reads.'
  475. ),
  476. 'Innodb_data_writes' => __(
  477. 'The total number of data writes.'
  478. ),
  479. 'Innodb_data_written' => __(
  480. 'The amount of data written so far, in bytes.'
  481. ),
  482. 'Innodb_dblwr_pages_written' => __(
  483. 'The number of pages that have been written for'
  484. . ' doublewrite operations.'
  485. ),
  486. 'Innodb_dblwr_writes' => __(
  487. 'The number of doublewrite operations that have been performed.'
  488. ),
  489. 'Innodb_log_waits' => __(
  490. 'The number of waits we had because log buffer was too small and'
  491. . ' we had to wait for it to be flushed before continuing.'
  492. ),
  493. 'Innodb_log_write_requests' => __(
  494. 'The number of log write requests.'
  495. ),
  496. 'Innodb_log_writes' => __(
  497. 'The number of physical writes to the log file.'
  498. ),
  499. 'Innodb_os_log_fsyncs' => __(
  500. 'The number of fsync() writes done to the log file.'
  501. ),
  502. 'Innodb_os_log_pending_fsyncs' => __(
  503. 'The number of pending log file fsyncs.'
  504. ),
  505. 'Innodb_os_log_pending_writes' => __(
  506. 'Pending log file writes.'
  507. ),
  508. 'Innodb_os_log_written' => __(
  509. 'The number of bytes written to the log file.'
  510. ),
  511. 'Innodb_pages_created' => __(
  512. 'The number of pages created.'
  513. ),
  514. 'Innodb_page_size' => __(
  515. 'The compiled-in InnoDB page size (default 16KB). Many values are'
  516. . ' counted in pages; the page size allows them to be easily'
  517. . ' converted to bytes.'
  518. ),
  519. 'Innodb_pages_read' => __(
  520. 'The number of pages read.'
  521. ),
  522. 'Innodb_pages_written' => __(
  523. 'The number of pages written.'
  524. ),
  525. 'Innodb_row_lock_current_waits' => __(
  526. 'The number of row locks currently being waited for.'
  527. ),
  528. 'Innodb_row_lock_time_avg' => __(
  529. 'The average time to acquire a row lock, in milliseconds.'
  530. ),
  531. 'Innodb_row_lock_time' => __(
  532. 'The total time spent in acquiring row locks, in milliseconds.'
  533. ),
  534. 'Innodb_row_lock_time_max' => __(
  535. 'The maximum time to acquire a row lock, in milliseconds.'
  536. ),
  537. 'Innodb_row_lock_waits' => __(
  538. 'The number of times a row lock had to be waited for.'
  539. ),
  540. 'Innodb_rows_deleted' => __(
  541. 'The number of rows deleted from InnoDB tables.'
  542. ),
  543. 'Innodb_rows_inserted' => __(
  544. 'The number of rows inserted in InnoDB tables.'
  545. ),
  546. 'Innodb_rows_read' => __(
  547. 'The number of rows read from InnoDB tables.'
  548. ),
  549. 'Innodb_rows_updated' => __(
  550. 'The number of rows updated in InnoDB tables.'
  551. ),
  552. 'Key_blocks_not_flushed' => __(
  553. 'The number of key blocks in the key cache that have changed but'
  554. . ' haven\'t yet been flushed to disk. It used to be known as'
  555. . ' Not_flushed_key_blocks.'
  556. ),
  557. 'Key_blocks_unused' => __(
  558. 'The number of unused blocks in the key cache. You can use this'
  559. . ' value to determine how much of the key cache is in use.'
  560. ),
  561. 'Key_blocks_used' => __(
  562. 'The number of used blocks in the key cache. This value is a'
  563. . ' high-water mark that indicates the maximum number of blocks'
  564. . ' that have ever been in use at one time.'
  565. ),
  566. 'Key_buffer_fraction_%' => __(
  567. 'Percentage of used key cache (calculated value)'
  568. ),
  569. 'Key_read_requests' => __(
  570. 'The number of requests to read a key block from the cache.'
  571. ),
  572. 'Key_reads' => __(
  573. 'The number of physical reads of a key block from disk. If Key_reads'
  574. . ' is big, then your key_buffer_size value is probably too small.'
  575. . ' The cache miss rate can be calculated as'
  576. . ' Key_reads/Key_read_requests.'
  577. ),
  578. 'Key_read_ratio_%' => __(
  579. 'Key cache miss calculated as rate of physical reads compared'
  580. . ' to read requests (calculated value)'
  581. ),
  582. 'Key_write_requests' => __(
  583. 'The number of requests to write a key block to the cache.'
  584. ),
  585. 'Key_writes' => __(
  586. 'The number of physical writes of a key block to disk.'
  587. ),
  588. 'Key_write_ratio_%' => __(
  589. 'Percentage of physical writes compared'
  590. . ' to write requests (calculated value)'
  591. ),
  592. 'Last_query_cost' => __(
  593. 'The total cost of the last compiled query as computed by the query'
  594. . ' optimizer. Useful for comparing the cost of different query'
  595. . ' plans for the same query. The default value of 0 means that'
  596. . ' no query has been compiled yet.'
  597. ),
  598. 'Max_used_connections' => __(
  599. 'The maximum number of connections that have been in use'
  600. . ' simultaneously since the server started.'
  601. ),
  602. 'Not_flushed_delayed_rows' => __(
  603. 'The number of rows waiting to be written in INSERT DELAYED queues.'
  604. ),
  605. 'Opened_tables' => __(
  606. 'The number of tables that have been opened. If opened tables is'
  607. . ' big, your table cache value is probably too small.'
  608. ),
  609. 'Open_files' => __(
  610. 'The number of files that are open.'
  611. ),
  612. 'Open_streams' => __(
  613. 'The number of streams that are open (used mainly for logging).'
  614. ),
  615. 'Open_tables' => __(
  616. 'The number of tables that are open.'
  617. ),
  618. 'Qcache_free_blocks' => __(
  619. 'The number of free memory blocks in query cache. High numbers can'
  620. . ' indicate fragmentation issues, which may be solved by issuing'
  621. . ' a FLUSH QUERY CACHE statement.'
  622. ),
  623. 'Qcache_free_memory' => __(
  624. 'The amount of free memory for query cache.'
  625. ),
  626. 'Qcache_hits' => __(
  627. 'The number of cache hits.'
  628. ),
  629. 'Qcache_inserts' => __(
  630. 'The number of queries added to the cache.'
  631. ),
  632. 'Qcache_lowmem_prunes' => __(
  633. 'The number of queries that have been removed from the cache to'
  634. . ' free up memory for caching new queries. This information can'
  635. . ' help you tune the query cache size. The query cache uses a'
  636. . ' least recently used (LRU) strategy to decide which queries'
  637. . ' to remove from the cache.'
  638. ),
  639. 'Qcache_not_cached' => __(
  640. 'The number of non-cached queries (not cachable, or not cached'
  641. . ' due to the query_cache_type setting).'
  642. ),
  643. 'Qcache_queries_in_cache' => __(
  644. 'The number of queries registered in the cache.'
  645. ),
  646. 'Qcache_total_blocks' => __(
  647. 'The total number of blocks in the query cache.'
  648. ),
  649. 'Rpl_status' => __(
  650. 'The status of failsafe replication (not yet implemented).'
  651. ),
  652. 'Select_full_join' => __(
  653. 'The number of joins that do not use indexes. If this value is'
  654. . ' not 0, you should carefully check the indexes of your tables.'
  655. ),
  656. 'Select_full_range_join' => __(
  657. 'The number of joins that used a range search on a reference table.'
  658. ),
  659. 'Select_range_check' => __(
  660. 'The number of joins without keys that check for key usage after'
  661. . ' each row. (If this is not 0, you should carefully check the'
  662. . ' indexes of your tables.)'
  663. ),
  664. 'Select_range' => __(
  665. 'The number of joins that used ranges on the first table. (It\'s'
  666. . ' normally not critical even if this is big.)'
  667. ),
  668. 'Select_scan' => __(
  669. 'The number of joins that did a full scan of the first table.'
  670. ),
  671. 'Slave_open_temp_tables' => __(
  672. 'The number of temporary tables currently'
  673. . ' open by the slave SQL thread.'
  674. ),
  675. 'Slave_retried_transactions' => __(
  676. 'Total (since startup) number of times the replication slave SQL'
  677. . ' thread has retried transactions.'
  678. ),
  679. 'Slave_running' => __(
  680. 'This is ON if this server is a slave that is connected to a master.'
  681. ),
  682. 'Slow_launch_threads' => __(
  683. 'The number of threads that have taken more than slow_launch_time'
  684. . ' seconds to create.'
  685. ),
  686. 'Slow_queries' => __(
  687. 'The number of queries that have taken more than long_query_time'
  688. . ' seconds.'
  689. ),
  690. 'Sort_merge_passes' => __(
  691. 'The number of merge passes the sort algorithm has had to do.'
  692. . ' If this value is large, you should consider increasing the'
  693. . ' value of the sort_buffer_size system variable.'
  694. ),
  695. 'Sort_range' => __(
  696. 'The number of sorts that were done with ranges.'
  697. ),
  698. 'Sort_rows' => __(
  699. 'The number of sorted rows.'
  700. ),
  701. 'Sort_scan' => __(
  702. 'The number of sorts that were done by scanning the table.'
  703. ),
  704. 'Table_locks_immediate' => __(
  705. 'The number of times that a table lock was acquired immediately.'
  706. ),
  707. 'Table_locks_waited' => __(
  708. 'The number of times that a table lock could not be acquired'
  709. . ' immediately and a wait was needed. If this is high, and you have'
  710. . ' performance problems, you should first optimize your queries,'
  711. . ' and then either split your table or tables or use replication.'
  712. ),
  713. 'Threads_cached' => __(
  714. 'The number of threads in the thread cache. The cache hit rate can'
  715. . ' be calculated as Threads_created/Connections. If this value is'
  716. . ' red you should raise your thread_cache_size.'
  717. ),
  718. 'Threads_connected' => __(
  719. 'The number of currently open connections.'
  720. ),
  721. 'Threads_created' => __(
  722. 'The number of threads created to handle connections. If'
  723. . ' Threads_created is big, you may want to increase the'
  724. . ' thread_cache_size value. (Normally this doesn\'t give a notable'
  725. . ' performance improvement if you have a good thread'
  726. . ' implementation.)'
  727. ),
  728. 'Threads_cache_hitrate_%' => __(
  729. 'Thread cache hit rate (calculated value)'
  730. ),
  731. 'Threads_running' => __(
  732. 'The number of threads that are not sleeping.'
  733. )
  734. );
  735. }
  736. ?>