mysql-5.7 show engine innodb status 详解

一、show engine innodb status 简介:

  show engine innodb status 是mysql提供的一个用于查看innodb引擎时间信息的工具,就目前来说有两处比较

  常用的地方一、死锁分析 二、innodb内存使用情况

 

二、通过show engine innodb status 查看内存使用情况:

  1、show variables like 'innodb_buffer_pool_size' 查看buffer pool 的内存配置

show variables like 'innodb_buffer_pool_size';
+-------------------------+-----------+
| Variable_name           | Value     |
+-------------------------+-----------+
| innodb_buffer_pool_size | 268435456 |
+-------------------------+-----------+
1 row in set (0.01 sec)

mysql> select 268435456/1024/1024 as innodb_buffer_pool_size_in_MB;
+-------------------------------+
| innodb_buffer_pool_size_in_MB |
+-------------------------------+
|                  256.00000000 |
+-------------------------------+
1 row in set (0.00 sec)

  2、通过show engine innodb status 查看内存使用明细

show engine innodb status ;

----------------------
BUFFER POOL AND MEMORY
----------------------
Total large memory allocated 274857984
Dictionary memory allocated 116177
Buffer pool size   16382
Free buffers       16002
Database pages     380
Old database pages 0
Modified db pages  0
Pending reads      0
Pending writes: LRU 0, flush list 0, single page 0
Pages made young 0, not young 0
0.00 youngs/s, 0.00 non-youngs/s
Pages read 345, created 35, written 37
0.00 reads/s, 0.00 creates/s, 0.00 writes/s
No buffer pool page gets since the last printout
Pages read ahead 0.00/s, evicted without access 0.00/s, Random read ahead 0.00/s
LRU len: 380, unzip_LRU len: 0
I/O sum[0]:cur[0], unzip sum[0]:cur[0]

 

三、对BUFFER POOL AND MEMORY 各项的说明:

  1、Total large memory allocated                  分配给innodb 的总内存大小、单位byte

  2、Dictionary memory allocated                  分析给innodb 数据字典的内存大小、单位byte

  3、Buffer pool size                                    innodb buffer pool的大小、单位page  如果page的大小设置为16k的话

  那么这个值乘以16就是innodb buffer pool 的大小(单位kb)

show global variables like 'innodb_buffer_pool_size';
+-------------------------+-----------+
| Variable_name           | Value     |
+-------------------------+-----------+
| innodb_buffer_pool_size | 268435456 |
+-------------------------+-----------+
1 row in set (0.00 sec)

mysql> select 16384*16*1024 as innodb_buffer_pool_size_in_byte;
+---------------------------------+
| innodb_buffer_pool_size_in_byte |
+---------------------------------+
|                       268435456 |
+---------------------------------+

  4、Free buffers              innodb buffer pool中空闲页面的数量,单位page

  5、Database pages            innodb buffer pool中非空闲页面的数量, 单位page

  6、Old database pages           old 子列表中的页面数量,单位page

  7、Modified db pages             当前buffer pool中被修改的页面数量,单位page

  8、Pending reads               数据由磁盘读到buffer pool,被挂起的次数

  9、Pending writes: LRU          innodb buffer pool old 子列表的页面被淘汰出内存,要写入到磁盘,但是

  这个写入被挂起的次数

  10、flush list               check point 操作期间页面要被写入到磁盘,但是这个写入被挂起的次数

  11、single page              单个页面要被写入到磁盘,但是这个写入过程被挂起的次数

  12、Pages made young          页面由old列表移动到new列表的次数

  13、not young               页面由new列表移动表old列表的次数

  14、youngs/s                平均每秒有多少个页面由old移动到new

  15、non-youngs/s             平均每秒有多少个页面由new移动到old

  16、Pages read               从buffer pool中读出页面的总数

  17、created                在innodb buffer pool中创建页面的总数

  18、written                 innodb buffer pool中被写过的页面总数

  19、reads/s                平均每秒从innodb buffer pool中读多少页

  20、creates/s               平均每秒innodb buffer pool要创建多少页

  21、writes/s               平均每少innodb buffer pool有多少页面被写

  22、buffer pool hit rate          innodb buffer pool 命中率

  23、Pages read ahead           平均每秒read ahead的次数

  24、evicted without access        平均每秒页面淘汰的次数

  25、Random read ahead          平均每秒random read ahead的次数

 

----

交流学习&打赏

 

posted on 2017-09-10 22:06  蒋乐兴的技术随笔  阅读(1887)  评论(0编辑  收藏  举报

导航