时间:2021-07-01 10:21:17 帮助过:31人阅读
mysql> use sakila;
Reading table information for completion of table and column names
You can turn off this feature to get a quicker startup with -A
Database changed
mysql> show engine innodb status \G;
*************************** 1. row ***************************
Type: InnoDB
Name:
Status:
=====================================
151102 7:13:01 INNODB MONITOR OUTPUT
=====================================
Per second averages calculated from the last 15 seconds
-----------------
BACKGROUND THREAD
-----------------
srv_master_thread loops: 113 1_second, 113 sleeps, 7 10_second, 47 background, 47 flush
srv_master_thread log flush and writes: 113
----------
SEMAPHORES
----------
OS WAIT ARRAY INFO: reservation count 18, signal count 18
Mutex spin waits 8, rounds 240, OS waits 7
RW-shared spins 11, rounds 330, OS waits 11
RW-excl spins 0, rounds 0, OS waits 0
Spin rounds per wait: 30.00 mutex, 30.00 RW-shared, 0.00 RW-excl
------------
TRANSACTIONS
------------
Trx id counter B0A
Purge done for trx's n:o < 920 undo n:o < 0
History list length 103
LIST OF TRANSACTIONS FOR EACH SESSION:
---TRANSACTION 0, not started
MySQL thread id 28, OS thread handle 0x7f5dbdfe6700, query id 568 localhost root
show engine innodb status
--------
FILE I/O
--------
I/O thread 0 state: waiting for i/o request (insert buffer thread)
I/O thread 1 state: waiting for i/o request (log thread)
I/O thread 2 state: waiting for i/o request (read thread)
I/O thread 3 state: waiting for i/o request (read thread)
I/O thread 4 state: waiting for i/o request (read thread)
I/O thread 5 state: waiting for i/o request (read thread)
I/O thread 6 state: waiting for i/o request (write thread)
I/O thread 7 state: waiting for i/o request (write thread)
I/O thread 8 state: waiting for i/o request (write thread)
I/O thread 9 state: waiting for i/o request (write thread)
Pending normal aio reads: 0 [0, 0, 0, 0] , aio writes: 0 [0, 0, 0, 0] ,
ibuf aio reads: 0, log i/o's: 0, sync i/o's: 0
Pending flushes (fsync) log: 0; buffer pool: 0
586 OS file reads, 55 OS file writes, 48 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 553229, node heap has 1 buffer(s)
0.00 hash searches/s, 0.00 non-hash searches/s
---
LOG
---
Log sequence number 13476957
Log flushed up to 13476957
Last checkpoint at 13476957
0 pending log writes, 0 pending chkp writes
32 log i/o's done, 0.00 log i/o's/second
----------------------
BUFFER POOL AND MEMORY
----------------------
Total memory allocated 274726912; in additional pool allocated 0
Dictionary memory allocated 182244
Buffer pool size 16383
Free buffers 15829
Database pages 553
Old database pages 224
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 553, created 0, written 27
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: 553, unzip_LRU len: 0
I/O sum[0]:cur[0], unzip sum[0]:cur[0]
--------------
ROW OPERATIONS
--------------
0 queries inside InnoDB, 0 queries in queue
1 read views open inside InnoDB
Main thread process no. 62305, id 140040552920832, state: waiting for server activity
Number of rows inserted 5, 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)
ERROR:
No query specified
mysql> set global hot_cache.key_buffer_size = 128* 1024;
Query OK, 0 rows affected (0.00 sec)
mysql> set global hot_cache.key_buffer_size = 0;
Query OK, 0 rows affected (0.00 sec)
mysql> show variables like 'key_buffer_size';
+-----------------+----------+
| Variable_name | Value |
+-----------------+----------+
| key_buffer_size | 33554432 |
+-----------------+----------+
1 row in set (0.00 sec)
mysql> set global key_buffer_size = 0;
ERROR 1438 (HY000): Cannot drop default keycache
mysql> show warnings;
+-------+------+------------------------------+
| Level | Code | Message |
+-------+------+------------------------------+
| Error | 1438 | Cannot drop default keycache |
+-------+------+------------------------------+
1 row in set (0.00 sec)
mysql> cache index sales,sales2 in hot_cache;
+---------------+--------------------+----------+-------------------------------------+
| Table | Op | Msg_type | Msg_text |
+---------------+--------------------+----------+-------------------------------------+
| sakila.sales | assign_to_keycache | Error | Table 'sakila.sales' doesn't exist |
| sakila.sales | assign_to_keycache | status | Operation failed |
| sakila.sales2 | assign_to_keycache | Error | Table 'sakila.sales2' doesn't exist |
| sakila.sales2 | assign_to_keycache | status | Operation failed |
+---------------+--------------------+----------+-------------------------------------+
4 rows in set (0.00 sec)
mysql> set global key_cache_division_limit = 70;
Query OK, 0 rows affected (0.00 sec)
mysql> set global hot_cache.key_cache_division_limit = 70;
Query OK, 0 rows affected (0.00 sec)
mysql> show global variables like '%innodb_old_blocks_pct%';
+-----------------------+-------+
| Variable_name | Value |
+-----------------------+-------+
| innodb_old_blocks_pct | 37 |
+-----------------------+-------+
1 row in set (0.01 sec)
mysql> show global variables like '%doublewrirte%';
Empty set (0.00 sec)
mysql> show global variables like '%doublewrite%';
+--------------------+-------+
| Variable_name | Value |
+--------------------+-------+
| innodb_doublewrite | ON |
+--------------------+-------+
1 row in set (0.01 sec)
mysql> select @a1 := variable_value as a1;
ERROR 1054 (42S22): Unknown column 'variable_value' in 'field list'
mysql> select @a1 := variable_value as a1
-> from information_schema.global_status
-> where variable_name = 'innodb_os_log_written'
-> union all
-> select sleep(60)
-> union all
-> select @a2 := variable_value as a2
-> from information_schema.global_status
-> where variable_name = 'innodb_os_log_written';
+------+
| a1 |
+------+
| 9216 |
| 0 |
| 9216 |
+------+
3 rows in set (1 min 0.02 sec)
mysql> select round((@a2-@a1)/1024/1024 / @@innodb_log_files_in_group) as MB;
+------+
| MB |
+------+
| 0 |
+------+
1 row in set (0.01 sec)