看到一段很长的信息在 mysqld.err 中:InnoDB: Warning: a long semaphore wait:
--Thread 1198979392 has waited at btr/btr0cur.c line 385 for 241.00 seconds the semaphore:
S-lock on RW-latch at 0x2aacd828e3c0 created in file dict/dict0dict.c line 1356
a writer (thread id 1198180672) has reserved it in mode  exclusive
number of readers 0, waiters flag 1
Last time read locked in file btr/btr0cur.c line 385
Last time write locked in file btr/btr0btr.c line 2792
InnoDB: ###### Starts InnoDB Monitor for 30 secs to print diagnostic info:
InnoDB: Pending preads 0, pwrites 0=====================================
100519 12:20:13 INNODB MONITOR OUTPUT
=====================================
Per second averages calculated from the last 39 seconds
----------
SEMAPHORES
----------
OS WAIT ARRAY INFO: reservation count 45965826, signal count 12110913
--Thread 1198979392 has waited at btr/btr0cur.c line 385 for 244.00 seconds the semaphore:
S-lock on RW-latch at 0x2aacd828e3c0 created in file dict/dict0dict.c line 1356
a writer (thread id 1198180672) has reserved it in mode  exclusive
number of readers 0, waiters flag 1
Last time read locked in file btr/btr0cur.c line 385
Last time write locked in file btr/btr0btr.c line 2792
--Thread 1212291392 has waited at btr/btr0cur.c line 385 for 220.00 seconds the semaphore:
S-lock on RW-latch at 0x2aacd828e3c0 created in file dict/dict0dict.c line 1356
a writer (thread id 1198180672) has reserved it in mode  exclusive
number of readers 0, waiters flag 1
Last time read locked in file btr/btr0cur.c line 385
Last time write locked in file btr/btr0btr.c line 2792
--Thread 1190193472 has waited at btr/btr0cur.c line 385 for 196.00 seconds the semaphore:
S-lock on RW-latch at 0x2aacd828e3c0 created in file dict/dict0dict.c line 1356
a writer (thread id 1198180672) has reserved it in mode  exclusive
number of readers 0, waiters flag 1
Last time read locked in file btr/btr0cur.c line 385
Last time write locked in file btr/btr0btr.c line 2792
--Thread 1193920832 has waited at btr/btr0cur.c line 385 for 166.00 seconds the semaphore:
S-lock on RW-latch at 0x2aacd828e3c0 created in file dict/dict0dict.c line 1356
a writer (thread id 1198180672) has reserved it in mode  exclusive
number of readers 0, waiters flag 1
Last time read locked in file btr/btr0cur.c line 385
Last time write locked in file btr/btr0btr.c line 2792
Mutex spin waits 0, rounds 183522681, OS waits 926762
RW-shared spins 29546766, OS waits 29285697; RW-excl spins 15772267, OS waits 15607931
------------
TRANSACTIONS
------------
Trx id counter 0 1784926064
Purge done for trx's n:o < 0 1784891101 undo n:o < 0 0
History list length 3154
LIST OF TRANSACTIONS FOR EACH SESSION:
---TRANSACTION 0 1784926027, not started, process no 12350, OS thread id 1198713152
MySQL thread id 650254, query id 708356696 172.29.52.155 DMClient
---TRANSACTION 0 1784926025, not started, process no 12350, OS thread id 1200843072
MySQL thread id 650252, query id 708356686 172.29.52.155 DMClient
---TRANSACTION 0 1784926024, not started, process no 12350, OS thread id 1191790912
MySQL thread id 650253, query id 708356679 172.29.52.155 DMClient
---TRANSACTION 0 1784925899, not started, process no 12350, OS thread id 1197914432
MySQL thread id 650251, query id 708355844 172.29.51.156 DMClient
---TRANSACTION 0 1784925897, not started, process no 12350, OS thread id 1204836672
MySQL thread id 650250, query id 708355823 172.29.51.156 DMClient
---TRANSACTION 0 1784926013, not started, process no 12350, OS thread id 1189660992
MySQL thread id 650249, query id 708356600 172.29.52.155 DMClient
---TRANSACTION 0 1784925924, not started, process no 12350, OS thread id 1221876032
MySQL thread id 650248, query id 708355959 172.29.51.156 DMClient
---TRANSACTION 0 1784926062, not started, process no 12350, OS thread id 1212823872 starting index read, thread declared inside InnoDB 500
mysql tables in use 4, locked 0
MySQL thread id 650247, query id 708356973 172.29.30.114 DMClient Sending data
SELECT * FROM Rating a WHERE ...
---TRANSACTION 0 1784925891, not started, process no 12350, OS thread id 1223473472
MySQL thread id 650245, query id 708355784 172.29.51.156 DMClient
---TRANSACTION 0 1784925890, not started, process no 12350, OS thread id 1223739712
MySQL thread id 650244, query id 708355782 172.29.51.156 DMClient
---TRANSACTION 0 1784925928, not started, process no 12350, OS thread id 1192323392
MySQL thread id 650243, query id 708355989 172.29.51.156 DMClient
---TRANSACTION 0 1784925926, not started, process no 12350, OS thread id 1222940992
MySQL thread id 650242, query id 708355974 172.29.51.156 DMClient
---TRANSACTION 0 1784925922, not started, process no 12350, OS thread id 1193654592
MySQL thread id 650240, query id 708355949 172.29.51.156 DMClient
---TRANSACTION 0 1784925906, not started, process no 12350, OS thread id 1188862272
MySQL thread id 650232, query id 708355882 172.29.51.156 DMClient
---TRANSACTION 0 1784925905, not started, process no 12350, OS thread id 1200044352
MySQL thread id 650231, query id 708355880 172.29.51.156 DMClient
---TRANSACTION 0 1784925898, not started, process no 12350, OS thread id 1208830272
MySQL thread id 650230, query id 708355829 172.29.51.156 DMClient
---TRANSACTION 0 1784925896, not started, process no 12350, OS thread id 1202706752
MySQL thread id 650229, query id 708355821 172.29.51.156 DMClient
---TRANSACTION 0 1784925894, not started, process no 12350, OS thread id 1220544832
MySQL thread id 650228, query id 708355811 172.29.51.156 DMClient
---TRANSACTION 0 1784925893, not started, process no 12350, OS thread id 1213888832
MySQL thread id 650227, query id 708355806 172.29.51.156 DMClient
---TRANSACTION 0 1784925799, not started, process no 12350, OS thread id 1222142272
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 (write thread)
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
9382713 OS file reads, 49092661 OS file writes, 1119076 OS fsyncs
94.90 reads/s, 43152 avg bytes/read, 7.40 writes/s, 0.85 fsyncs/s
-------------------------------------
INSERT BUFFER AND ADAPTIVE HASH INDEX
-------------------------------------
Ibuf: size 1, free list len 24, seg size 26,
21848 inserts, 21848 merged recs, 15836 merges
Hash table size 17700857, node heap has 15289 buffer(s)
694.57 hash searches/s, 1848.36 non-hash searches/s
---
LOG
---
Log sequence number 48 4099767329
Log flushed up to   48 4099767329
Last checkpoint at  48 4099686752
0 pending log writes, 0 pending chkp writes
47224184 log i/o's done, 6.90 log i/o's/second
----------------------
BUFFER POOL AND MEMORY
----------------------
Total memory allocated 9517417556; in additional pool allocated 16777216
Dictionary memory allocated 2334360
Buffer pool size   524288
Free buffers       0
Database pages     508993
Modified db pages  24
Pending reads 0
Pending writes: LRU 0, flush list 0, single page 0
Pages read 19428701, created 117950, written 2585807
249.94 reads/s, 0.10 creates/s, 0.55 writes/s
Buffer pool hit rate 999 / 1000
--------------
ROW OPERATIONS
--------------
3 queries inside InnoDB, 0 queries in queue
7 read views open inside InnoDB
Main thread process no. 12350, id 1186199872, state: sleeping
Number of rows inserted 41207945, updated 6399374, deleted 28694884, read 8340843168
2.75 inserts/s, 0.00 updates/s, 18.15 deletes/s, 149034.00 reads/s
----------------------------
END OF INNODB MONITOR OUTPUT
============================
InnoDB: ###### Diagnostic info printed to the standard error stream