常用的地方一、死锁分析 二、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)
评论