VariablesController.php 28 KB

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