Variables.php 32 KB

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