使用show engine innodb status 查看内存使用情况

来源:这里教程网 时间:2026-03-01 16:35:09 作者:

一、使用show engine innodb status 查看内存使用情况: SQL>show engine innodb status\G ---------------------- BUFFER POOL AND MEMORY ---------------------- Total large memory allocated 17590910976 Dictionary memory allocated 5145259 Buffer pool size   1048576 Free buffers       8194 Database pages     1023443 Old database pages 377630 Modified db pages  75 Pending reads      0 Pending writes: LRU 0, flush list 0, single page 0 Pages made young 383665, not young 422572 0.00 youngs/s, 0.00 non-youngs/s Pages read 34668, created 1651482, written 170056767 0.00 reads/s, 0.00 creates/s, 18.27 writes/s Buffer pool hit rate 1000 / 1000, young-making rate 0 / 1000 not 0 / 1000 Pages read ahead 0.00/s, evicted without access 0.00/s, Random read ahead 0.00/s LRU len: 1023443, unzip_LRU len: 0 I/O sum[4064]:cur[0], unzip sum[0]:cur[0] ---------------------- root@[(none)]> show variables like 'innodb_buffer_pool_size'; +-------------------------+-------------+ | Variable_name           | Value       | +-------------------------+-------------+ | innodb_buffer_pool_size | 17179869184 | +-------------------------+-------------+ 1 row in set (0.01 sec) 二、MySQL数据库内存使用情况解析 1、Total large memory allocated 17590910976 分配给INNODB的总内存大小,单位byte,这里分配的是17179869184合计是16GB。 2、Dictionary memory allocated 5145259 分析给INNODB数据字典的内存大小,单位byte,这里分配的是5145259,合计约5MB。 3、Buffer pool size   1048576 分配给INNODB的总buffer pool大小,区别是这里单位page,MySQL默认page的大小设置为16k。 root@[(none)]> select 1048576*16*1024; +-----------------+ | 1048576*16*1024 | +-----------------+ |     17179869184 | +-----------------+ 1 row in set (0.00 sec) 这里其实只是换个单位。 4、Free buffers       8194 数据库中innodb buffer pool中空闲page的数量。 5、Database pages     1023443 数据库中innodb buffer pool中非空闲page的数量。 6、Old database pages 377630 Old子列表中的page数量 7、Modified db pages  75 当前buffer pool中被修改的page数量 8、Pending reads      0 数据由磁盘读到buffer pool,被挂起的次数 9、Pending writes: LRU 0, flush list 0, single page 0 数据库中innodb buffer pool LRU链表的page被淘汰出内存,要写入到磁盘,但是这个写入被挂起的次数 flush list:check point操作期间page要被写入到磁盘,但是这个写入被挂起的次数 single page:单个page要被写入到磁盘,但是这个写入过程被挂起的次数 10、Pages made young 383665, not young 422572     0.00 youngs/s, 0.00 non-youngs/s   young:page由old列表移动到new列表的次数.     not young:page由new列表移动表old列表的次数.     youngs/s:平均每秒有多少个page由old移动到new     non-youngs/s:平均每秒有多少个page由new移动到old 11、Pages read 34668, created 1651482, written 170056767     0.00 reads/s, 0.00 creates/s, 18.27 writes/s     read:从buffer pool中读出page的总数     created:在buffer pool中创建page的总数     written:在buffer pool中被写过的page总数     reads/s:平均每秒从buffer pool中读多少个page     creates/s:平均每秒在buffer pool要创建多少个page     writes/s:平均每秒在buffer pool有多少个page被写入 12、Buffer pool hit rate 1000 / 1000, young-making rate 0 / 1000 not 0 / 1000     MySQL数据库的buffer pool的命中率,OLAP一般都是无限接近1。 13、Pages read ahead 0.00/s, evicted without access 0.00/s, Random read ahead 0.00/s     每秒read ahead的次数,每秒淘汰的page次数,随机read ahead的次数 --------------End-By TangYun----------------------------------------------

相关推荐