MySQL 内存和CPU优化相关的参数

mysql> SHOW GLOBAL STATUS LIKE ‘innodb%read%‘;
+---------------------------------------+---------+
| Variable_name                         | Value   |
+---------------------------------------+---------+
| Innodb_buffer_pool_read_ahead_rnd     | 0       |
| Innodb_buffer_pool_read_ahead         | 0       |
| Innodb_buffer_pool_read_ahead_evicted | 0       |
| Innodb_buffer_pool_read_requests      | 612     |
| Innodb_buffer_pool_reads              | 179     |
| Innodb_data_pending_reads             | 0       |
| Innodb_data_read                      | 5115904 |
| Innodb_data_reads                     | 189     |
| Innodb_pages_read                     | 178     |
| Innodb_rows_read                      | 0       |
+---------------------------------------+---------+
10 rows in set (0.00 sec)

#多核CPU
innodb_read_io_threads
innodb_write_io_threads

#内存
缓冲池命中率=
Innodb_buffer_pool_read_requests/(
Innodb_buffer_pool_read_requests+Innodb_buffer_pool_read_ahead+Innodb_buffer_pool_reads)
平均每次读取字节数
Innodb_data_read/Innodb_data_reads

Innodb_data_reads:表示从物理磁盘读取页的次数
Innodb_buffer_pool_read_ahead:预读的次数
Innodb_buffer_pool_read_ahead_evicted:预读的页,但是没有被读取就从缓冲池中被替换的页的数量,一般用来判断预读的频率
Innodb_buffer_pool_read_requests:从缓冲池中读取页的次数
Innodb_data_read:一共读取的字节数
Innodb_data_reads:发起读取请求的次数,每次读取可能需要读取多个页

  

郑重声明:本站内容如果来自互联网及其他传播媒体,其版权均属原媒体及文章作者所有。转载目的在于传递更多信息及用于网络分享,并不代表本站赞同其观点和对其真实性负责,也不构成任何其他建议。