1. 程式人生 > >show engine innodb status 解讀

show engine innodb status 解讀

innodb status

mysql> show engine innodb status\G

*************************** 1. row ***************************

Type: InnoDB

Name:

Status:

=====================================

2018-02-24 18:15:52 0x7f2ac00dd700 INNODB MONITOR OUTPUT

=====================================

Per second averages calculated from the last 41 seconds





-----------------

BACKGROUND THREAD

-----------------

srv_master_thread loops: 2 srv_active, 0 srv_shutdown, 23859 srv_idle

srv_master_thread log flush and writes: 23860




----------

SEMAPHORES

----------

OS WAIT ARRAY INFO: reservation count 2

OS WAIT ARRAY INFO: signal count 2

RW-shared spins 0, rounds 4, OS waits 2

RW-excl spins 0, rounds 0, OS waits 0

RW-sx spins 0, rounds 0, OS waits 0

Spin rounds per wait: 4.00 RW-shared, 0.00 RW-excl, 0.00 RW-sx



------------------------

LATEST FOREIGN KEY ERROR

------------------------

2018-01-29 23:23:31 0x7f984875e700 Transaction:

TRANSACTION 171061511, ACTIVE 1 sec inserting

mysql tables in use 1, locked 1

10 lock struct(s), heap size 1136, 6 row lock(s), undo log entries 5





------------------------

LATEST DETECTED DEADLOCK ### 如果有死鎖發生,會有相關的記錄

------------------------

2018-02-24 18:52:09 2b6677e07700 -- 死鎖發生的時間

*** (1) TRANSACTION:

*** (2) TRANSACTION: -- 事務2的狀態


------------

TRANSACTIONS ### 包含了InnoDB事務(transaction)的統計信息

------------

Trx id counter 5892

Purge done for trx's n:o < 5386 undo n:o < 0 state: running but idle

History list length 3

LIST OF TRANSACTIONS FOR EACH SESSION:

---TRANSACTION 421297007339344, not started

0 lock struct(s), heap size 1136, 0 row lock(s)






--------

FILE I/O ###顯示了I/O Helper thread d的狀態,包含一些統計信息

--------

I/O thread 0 state: waiting for completed aio requests (insert buffer thread)

I/O thread 1 state: waiting for completed aio requests (log thread)

I/O thread 2 state: waiting for completed aio requests (read thread)

I/O thread 3 state: waiting for completed aio requests (read thread)

I/O thread 4 state: waiting for completed aio requests (read thread)

I/O thread 5 state: waiting for completed aio requests (read thread)

I/O thread 6 state: waiting for completed aio requests (write thread)

I/O thread 7 state: waiting for completed aio requests (write thread)

I/O thread 8 state: waiting for completed aio requests (write thread)

I/O thread 9 state: waiting for completed aio requests (write thread)

Pending normal aio reads: [0, 0, 0, 0] , aio writes: [0, 0, 0, 0] ,

ibuf aio reads:, log i/o's:, sync i/o's:

Pending flushes (fsync) log: 0; buffer pool: 0

384 OS file reads, 59 OS file writes, 7 OS fsyncs

0.00 reads/s, 0 avg bytes/read, 0.00 writes/s, 0.00 fsyncs/s





-------------------------------------

INSERT BUFFER AND ADAPTIVE HASH INDEX

-------------------------------------

Ibuf: size 1, free list len 0, seg size 2, 0 merges

merged operations:

insert 0, delete mark 0, delete 0

discarded operations:

insert 0, delete mark 0, delete 0

Hash table size 34679, node heap has 0 buffer(s)

Hash table size 34679, node heap has 0 buffer(s)

Hash table size 34679, node heap has 0 buffer(s)

Hash table size 34679, node heap has 0 buffer(s)

Hash table size 34679, node heap has 0 buffer(s)

Hash table size 34679, node heap has 0 buffer(s)

Hash table size 34679, node heap has 0 buffer(s)

Hash table size 34679, node heap has 0 buffer(s)

0.00 hash searches/s, 0.00 non-hash searches/s




---

LOG ###記錄了transaction log 子系統的信息

---

Log sequence number 370441977

Log flushed up to 370441977

Pages flushed up to 370441977

Last checkpoint at 370441968

0 pending log flushes, 0 pending chkp writes

10 log i/o's done, 0.00 log i/o's/second







----------------------

BUFFER POOL AND MEMORY #####INNODB BUFFER POOL 狀態,

----------------------

Total large memory allocated 137428992 --分配給innodb 的總內存大小、單位byte

Dictionary memory allocated 147231 --分配給innodb 數據字典的內存大小、單位byte

Buffer pool size 8192 --innodb buffer pool的大小、單位page 如果page的大小設置為16k的話 *16*1024 = innodb_buffer_pool_size

Free buffers 7914 --innodb buffer pool中空閑頁面的數量,單位page

Database pages 278 --innodb buffer pool中非空閑頁面的數量, 單位page

Old database pages 0 --old 子列表中的頁面數量,單位page

Modified db pages 0 --當前buffer pool中被修改的頁面數量,單位page

Pending reads 0 -- 數據由磁盤讀到buffer pool,被掛起的次數

Pending writes: LRU 0, flush list 0, single page 0

Pages made young 0, not young 0 --Pages made young頁面由old列表移動到new列表的次數;not young 頁面由new列表移動表old列表的次數

0.00 youngs/s, 0.00 non-youngs/s --youngs/s平均每秒有多少個頁面由old移動到new,non-youngs/s平均每秒有多少個頁面由new移動到old

Pages read 243, created 35, written 42 -- 從buffer pool中讀出頁面的總數;在innodb buffer pool中創建頁面的總數; innodb buffer pool中被寫過的頁面總數

0.00 reads/s, 0.14 creates/s, 42.14 writes/s -- 平均每秒從innodb buffer pool中讀多少頁,平均每秒innodb buffer pool要創建多少頁,平均每少innodb buffer pool有多少頁面被寫

Buffer pool hit rate 1000 / 1000, young-making rate 0 / 1000 not 0 / 1000 -- innodb buffer pool 命中率

Pages read ahead 0.00/s, evicted without access 0.00/s, Random read ahead 0.00/s

-- Pages read ahead 平均每秒read ahead的次數 ,evicted without access平均每秒頁面淘汰的次數 ,  Random read ahead 平均每秒random read ahead的次數

LRU len: 80675, unzip_LRU len: 0

I/O sum[10392]:cur[0], unzip sum[0]:cur[0]





----------------------

INDIVIDUAL BUFFER POOL INFO #############如設置了innodb_buffer_pool_instances,則有多個子pool

----------------------






--------------

ROW OPERATIONS

--------------

0 queries inside InnoDB, 0 queries in queue

0 read views open inside InnoDB

Process ID=2969, Main thread ID=139821729601280, state: sleeping

Number of rows inserted 0, updated 0, deleted 0, read 12

0.00 inserts/s, 0.00 updates/s, 0.00 deletes/s, 0.00 reads/s

----------------------------

END OF INNODB MONITOR OUTPUT

============================


1 row in set (0.00 sec)






mysql> \s

--------------

mysql  Ver 14.14 Distrib 5.7.20, for Linux (x86_64) using  EditLine wrapper
Connection id:4
Current database:performance_schema
Current user:root@localhost
SSL:Not in use
Current pager:stdout
Using outfile:''
Using delimiter:;
Server version:5.7.20-log MySQL Community Server (GPL)
Protocol version:10
Connection:Localhost via UNIX socket
Server characterset:utf8
Db     characterset:utf8
Client characterset:utf8
Conn.  characterset:utf8
UNIX socket:/var/lib/mysql/mysql.sock
Uptime:7 hours 28 min 8 sec
Threads: 3  Questions: 222  Slow queries: 0  Opens: 201  Flush tables: 1  Open tables: 194  Queries per second avg: 0.008
--------------





show engine innodb status 解讀