Re: MySQL optimization for testing purpose
I do a proper mysqladmin shutdown then I restart with bin/mysqld_safe ...
Here the SHOW ENGINE INNODB STATUS output, before and after slow down:
| InnoDB | |
=====================================
2018-04-09 15:28:48 0x7f543c20f700 INNODB MONITOR OUTPUT
=====================================
Per second averages calculated from the last 29 seconds
-----------------
BACKGROUND THREAD
-----------------
srv_master_thread loops: 9 srv_active, 0 srv_shutdown, 80 srv_idle
srv_master_thread log flush and writes: 89
----------
SEMAPHORES
----------
OS WAIT ARRAY INFO: reservation count 75
OS WAIT ARRAY INFO: signal count 69
RW-shared spins 12, rounds 21, OS waits 9
RW-excl spins 15, rounds 89, OS waits 1
RW-sx spins 0, rounds 0, OS waits 0
Spin rounds per wait: 1.75 RW-shared, 5.93 RW-excl, 0.00 RW-sx
------------
TRANSACTIONS
------------
Trx id counter 933706
Purge done for trx's n:o < 933700 undo n:o < 0 state: running but idle
History list length 20
LIST OF TRANSACTIONS FOR EACH SESSION:
---TRANSACTION 421474779719520, not started
0 lock struct(s), heap size 1136, 0 row lock(s)
--------
FILE I/O
--------
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
1063 OS file reads, 1902 OS file writes, 916 OS fsyncs
1.59 reads/s, 16384 avg bytes/read, 60.00 writes/s, 31.24 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 69257, node heap has 1 buffer(s)
Hash table size 69257, node heap has 2 buffer(s)
Hash table size 69257, node heap has 3 buffer(s)
Hash table size 69257, node heap has 1 buffer(s)
Hash table size 69257, node heap has 0 buffer(s)
Hash table size 69257, node heap has 1 buffer(s)
Hash table size 69257, node heap has 0 buffer(s)
Hash table size 69257, node heap has 0 buffer(s)
34.14 hash searches/s, 1073.76 non-hash searches/s
---
LOG
---
Log sequence number 1587269911
Log flushed up to 1587269911
Pages flushed up to 1587269911
Last checkpoint at 1587269911
0 pending log flushes, 0 pending chkp writes
645 log i/o's done, 21.86 log i/o's/second
----------------------
BUFFER POOL AND MEMORY
----------------------
Total large memory allocated 274857984
Dictionary memory allocated 415930
Buffer pool size 16384
Free buffers 14551
Database pages 1825
Old database pages 654
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 1040, created 785, written 1003
1.59 reads/s, 22.52 creates/s, 29.59 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: 1825, 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
0 read views open inside InnoDB
Process ID=14874, Main thread ID=139999212459776 , state=sleeping
Number of rows inserted 1876, updated 1553, deleted 1488, read 9866
64.69 inserts/s, 42.76 updates/s, 51.31 deletes/s, 180.89 reads/s
----------------------------
END OF INNODB MONITOR OUTPUT
============================
| InnoDB | |
=====================================
2018-04-09 15:33:19 0x7f543c20f700 INNODB MONITOR OUTPUT
=====================================
Per second averages calculated from the last 11 seconds
-----------------
BACKGROUND THREAD
-----------------
srv_master_thread loops: 84 srv_active, 0 srv_shutdown, 273 srv_idle
srv_master_thread log flush and writes: 357
----------
SEMAPHORES
----------
OS WAIT ARRAY INFO: reservation count 963
OS WAIT ARRAY INFO: signal count 862
RW-shared spins 152, rounds 207, OS waits 55
RW-excl spins 113, rounds 975, OS waits 18
RW-sx spins 0, rounds 0, OS waits 0
Spin rounds per wait: 1.36 RW-shared, 8.63 RW-excl, 0.00 RW-sx
------------
TRANSACTIONS
------------
Trx id counter 951316
Purge done for trx's n:o < 951316 undo n:o < 0 state: running but idle
History list length 46
LIST OF TRANSACTIONS FOR EACH SESSION:
---TRANSACTION 421474779720440, not started
0 lock struct(s), heap size 1136, 0 row lock(s)
---TRANSACTION 421474779719520, not started
0 lock struct(s), heap size 1136, 0 row lock(s)
--------
FILE I/O
--------
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: 1; buffer pool: 0
1074 OS file reads, 13717 OS file writes, 8474 OS fsyncs
0.00 reads/s, 0 avg bytes/read, 103.81 writes/s, 71.45 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 69257, node heap has 1 buffer(s)
Hash table size 69257, node heap has 2 buffer(s)
Hash table size 69257, node heap has 3 buffer(s)
Hash table size 69257, node heap has 1 buffer(s)
Hash table size 69257, node heap has 0 buffer(s)
Hash table size 69257, node heap has 1 buffer(s)
Hash table size 69257, node heap has 0 buffer(s)
Hash table size 69257, node heap has 0 buffer(s)
117.81 hash searches/s, 2394.06 non-hash searches/s
---
LOG
---
Log sequence number 1609678027
Log flushed up to 1609665895
Pages flushed up to 1606495968
Last checkpoint at 1606405412
1 pending log flushes, 0 pending chkp writes
5927 log i/o's done, 49.73 log i/o's/second
----------------------
BUFFER POOL AND MEMORY
----------------------
Total large memory allocated 274857984
Dictionary memory allocated 415930
Buffer pool size 16384
Free buffers 9294
Database pages 7082
Old database pages 2594
Modified db pages 774
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 1051, created 6031, written 5464
0.00 reads/s, 49.36 creates/s, 34.45 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: 7082, 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
0 read views open inside InnoDB
Process ID=14874, Main thread ID=139999212459776 , state=sleeping
Number of rows inserted 17548, updated 11913, deleted 13920, read 51438
147.44 inserts/s, 98.17 updates/s, 117.81 deletes/s, 393.78 reads/s
----------------------------
END OF INNODB MONITOR OUTPUT
============================