1. 如果 Unix
top 或 Windows 任务管理器(Task Manager) 显示服务的 CPU 占用率小于 70%,(shows
that the CPU usage percentage with your workload is less than 70 %,)你的系统瓶颈可能在磁盘读写上。或许你提交了大量的事务,或者是缓冲池(buffer
pool)太小了。将缓冲池设大点会有所帮助,但一定要注意不能大于物理内存的 80%。
=====================================
020805 22:07:41 INNODB MONITOR OUTPUT
=====================================
Per second averages calculated from the last 3 seconds
----------
SEMAPHORES
----------
OS WAIT ARRAY INFO: reservation count 194, signal count 193
--Thread 7176 has waited at ../include/btr0btr.ic line 28 for 0.00 seconds the s
emaphore:
X-lock on RW-latch at 44d980bc created in file buf0buf.c line 354
a writer (thread id 7176) has reserved it in mode wait exclusive
number of readers 1, waiters flag 1
Last time read locked in file ../include/btr0btr.ic line 28
Last time write locked in file ../include/btr0btr.ic line 28
Mutex spin waits 0, rounds 0, OS waits 0
RW-shared spins 77, OS waits 33; RW-excl spins 188, OS waits 161
------------
TRANSACTIONS
------------
Trx id counter 0 657853517
Purge done for trx's n:o < 0 657853429 undo n:o < 0 80
Total number of lock structs in row lock hash table 22
020805 22:07:36 LATEST DETECTED DEADLOCK:
*** (1) TRANSACTION:
TRANSACTION 0 657853503, ACTIVE 0 sec, OS thread id 15373 inserting
LOCK WAIT 3 lock struct(s), heap size 336
MySQL thread id 6, query id 3741 localhost heikki update
insert into ibtest11b (D, B, C) values (5, 'khdkkkk' ,'khdkkkk')
*** (1) WAITING FOR THIS LOCK TO BE GRANTED:
RECORD LOCKS space id 0 page no 104865 n bits 208 table test/ibtest11b index PRI
MARY trx id 0 657853503 lock_mode X waiting
Record lock, heap no 1 RECORD: info bits 0 0: len 9; hex 73757072656d756d00; asc
supremum.;;
*** (2) TRANSACTION:
TRANSACTION 0 657853500, ACTIVE 0 sec, OS thread id 11275 setting auto-inc lock
19 lock struct(s), heap size 2672, undo log entries 5
MySQL thread id 2, query id 3750 localhost heikki update
insert into ibtest11b (D, B, C) values (5, 'khD' ,'khD')
*** (2) HOLDS THE LOCK(S):
RECORD LOCKS space id 0 page no 104865 n bits 200 table test/ibtest11b index PRI
MARY trx id 0 657853500 lock_mode X
Record lock, heap no 1 RECORD: info bits 0 0: len 9; hex 73757072656d756d00; asc
supremum.;;
*** (2) WAITING FOR THIS LOCK TO BE GRANTED:
TABLE LOCK table test/ibtest11b trx id 0 657853500 lock_mode AUTO-INC waiting
*** WE ROLL BACK TRANSACTION (2)
LIST OF TRANSACTIONS FOR EACH SESSION:
---TRANSACTION 0 657853516, ACTIVE 5 sec, OS thread id 15373 setting auto-inc lo
ck
LOCK WAIT 1 lock struct(s), heap size 336
MySQL thread id 6, query id 3895 localhost heikki update
insert into ibtest11b (D, B, C) values (5, 'khdkkkk' ,'khdkkkk')
------- TRX HAS BEEN WAITING 5 SEC FOR THIS LOCK TO BE GRANTED:
TABLE LOCK table test/ibtest11b trx id 0 657853516 lock_mode AUTO-INC waiting
------------------
---TRANSACTION 0 657853514, ACTIVE 5 sec, OS thread id 11275 inserting
LOCK WAIT 13 lock struct(s), heap size 2672, undo log entries 2
MySQL thread id 2, query id 3898 localhost heikki update
insert into ibtest11d (D, B, C) values (5, 'khdkkkk' ,'khdkkkk')
------- TRX HAS BEEN WAITING 5 SEC FOR THIS LOCK TO BE GRANTED:
RECORD LOCKS space id 0 page no 104879 n bits 384 table test/ibtest11d index B t
rx id 0 657853514 lock_mode X gap type lock waiting
Record lock, heap no 130 RECORD: info bits 32 0: len 9; hex 6b48646b6b6b6b6b6b;
asc kHdkkkkkk;; 1:
------------------
---TRANSACTION 0 657853512, ACTIVE 5 sec, OS thread id 14348 updating or deletin
g
20 lock struct(s), heap size 2672, undo log entries 175
MySQL thread id 5, query id 3874 localhost heikki updating
delete from ibtest11a where A = 215
--------
FILE I/O
--------
I/O thread 0 state: waiting for i/o request
I/O thread 1 state: waiting for i/o request
I/O thread 2 state: waiting for i/o request
I/O thread 3 state: waiting for i/o request
Pending normal aio reads: 0, aio writes: 0,
ibuf aio reads: 0, log i/o's: 0, sync i/o's: 0
Pending flushes (fsync) log: 0; buffer pool: 0
272 OS file reads, 56 OS file writes, 29 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 for space 0: size 1, free list len 5, seg size 7,
0 inserts, 0 merged recs, 0 merges
Hash table size 124633, used cells 1530, node heap has 4 buffer(s)
2895.70 hash searches/s, 126.62 non-hash searches/s
---
LOG
---
Log sequence number 19 3267291494
Log flushed up to 19 3267283711
Last checkpoint at 19 3266545677
0 pending log writes, 0 pending chkp writes
30 log i/o's done, 0.00 log i/o's/second
----------------------
BUFFER POOL AND MEMORY
----------------------
Total memory allocated 82593970; in additional pool allocated 1406336
Buffer pool size 1920
Free buffers 1711
Database pages 205
Modified db pages 39
Pending reads 0
Pending writes: LRU 0, flush list 0, single page 0
Pages read 178, created 27, written 50
0.00 reads/s, 0.00 creates/s, 0.00 writes/s
Buffer pool hit rate 1000 / 1000
--------------
ROW OPERATIONS
--------------
1 queries inside InnoDB, 0 queries in queue; main thread: purging
Number of rows inserted 2008, updated 264, deleted 162, read 9
0.00 inserts/s, 0.00 updates/s, 14.66 deletes/s, 0.00 reads/s
----------------------------
END OF INNODB MONITOR OUTPUT
============================