MySQL 出现大量的 semaphore

jldzy 2015-01-07 03:14:42
在用进行压力测试读的时候,用show innodb status 发现 出现大量的semaphore, 这时候服务器(4CPU)负载非常高, 说明了什么? 怎么解决? 应该是在从硬盘读到 buffer pool 里面的时候发生了semaphore。



=====================================
150107 15:07:58 INNODB MONITOR OUTPUT
=====================================
Per second averages calculated from the last 53 seconds
----------
SEMAPHORES
----------
OS WAIT ARRAY INFO: reservation count 11434462, signal count 1022975
--Thread 1310349632 has waited at btr/btr0cur.c line 443 for 1.00 seconds the semaphore:
S-lock on RW-latch at 0x2aae848023b0 created in file buf/buf0buf.c line 547
a writer (thread id 1102367040) has reserved it in mode exclusive
number of readers 0, waiters flag 1
Last time read locked in file not yet reserved line 0
Last time write locked in file buf/buf0buf.c line 1797
--Thread 1323194688 has waited at btr/btr0cur.c line 443 for 3.00 seconds the semaphore:
S-lock on RW-latch at 0x2aae84744690 created in file buf/buf0buf.c line 547
a writer (thread id 1276631360) has reserved it in mode exclusive
number of readers 0, waiters flag 1
Last time read locked in file not yet reserved line 0
Last time write locked in file buf/buf0buf.c line 1797
--Thread 1250740544 has waited at btr/btr0cur.c line 443 for 9.00 seconds the semaphore:
S-lock on RW-latch at 0x2aae845dd1d0 created in file buf/buf0buf.c line 547
a writer (thread id 1318979904) has reserved it in mode exclusive
number of readers 0, waiters flag 1
Last time read locked in file not yet reserved line 0
Last time write locked in file buf/buf0buf.c line 1797
--Thread 1249335616 has waited at trx/trx0trx.c line 715 for 0.00 seconds the semaphore:
Mutex at 0x2aaab73db2b8 created file srv/srv0srv.c line 875, lock var 1
waiters flag 0
--Thread 1235487040 has waited at trx/trx0trx.c line 986 for 0.00 seconds the semaphore:
Mutex at 0x2aaab73db2b8 created file srv/srv0srv.c line 875, lock var 1
waiters flag 0
--Thread 1325201728 has waited at btr/btr0cur.c line 443 for 4.00 seconds the semaphore:
S-lock on RW-latch at 0x2aae84692670 created in file buf/buf0buf.c line 547
a writer (thread id 1318377792) has reserved it in mode exclusive
number of readers 0, waiters flag 1
Last time read locked in file not yet reserved line 0
Last time write locked in file buf/buf0buf.c line 1797
--Thread 1298708800 has waited at btr/btr0cur.c line 443 for 3.00 seconds the semaphore:
S-lock on RW-latch at 0x2aae84485bb0 created in file buf/buf0buf.c line 547
a writer (thread id 1302321472) has reserved it in mode exclusive
number of readers 0, waiters flag 1
Last time read locked in file not yet reserved line 0
Last time write locked in file buf/buf0buf.c line 1797
--Thread 1219631424 has waited at btr/btr0cur.c line 443 for 5.00 seconds the semaphore:
S-lock on RW-latch at 0x2aae84704c10 created in file buf/buf0buf.c line 547
a writer (thread id 1178487104) has reserved it in mode exclusive
number of readers 0, waiters flag 1
Last time read locked in file not yet reserved line 0
Last time write locked in file buf/buf0buf.c line 1797
--Thread 1222240576 has waited at btr/btr0cur.c line 443 for 12.00 seconds the semaphore:
S-lock on RW-latch at 0x2aae84248010 created in file buf/buf0buf.c line 547
a writer (thread id 1254553920) has reserved it in mode exclusive
number of readers 0, waiters flag 1
Last time read locked in file not yet reserved line 0
Last time write locked in file buf/buf0buf.c line 1797
--Thread 1172465984 has waited at trx/trx0trx.c line 1578 for 0.00 seconds the semaphore:
Mutex at 0x2aaab73db2b8 created file srv/srv0srv.c line 875, lock var 0
waiters flag 0
--Thread 1230870848 has waited at trx/trx0trx.c line 715 for 0.00 seconds the semaphore:
Mutex at 0x2aaab73db2b8 created file srv/srv0srv.c line 875, lock var 0
waiters flag 0
--Thread 1225853248 has waited at trx/trx0trx.c line 1578 for 0.00 seconds the semaphore:
Mutex at 0x2aaab73db2b8 created file srv/srv0srv.c line 875, lock var 1
waiters flag 0
--Thread 1184508224 has waited at trx/trx0trx.c line 1578 for 0.00 seconds the semaphore:
Mutex at 0x2aaab73db2b8 created file srv/srv0srv.c line 875, lock var 0
waiters flag 0
--Thread 1312356672 has waited at trx/trx0trx.c line 715 for 0.00 seconds the semaphore:
Mutex at 0x2aaab73db2b8 created file srv/srv0srv.c line 875, lock var 1
waiters flag 0
--Thread 1231071552 has waited at trx/trx0trx.c line 986 for 0.00 seconds the semaphore:
Mutex at 0x2aaab73db2b8 created file srv/srv0srv.c line 875, lock var 1
waiters flag 0
--Thread 1355106624 has waited at btr/btr0cur.c line 443 for 3.00 seconds the semaphore:
S-lock on RW-latch at 0x2aae847ad3f0 created in file buf/buf0buf.c line 547
a writer (thread id 1327208768) has reserved it in mode exclusive
number of readers 0, waiters flag 1
Last time read locked in file not yet reserved line 0
Last time write locked in file buf/buf0buf.c line 1797
--Thread 1276832064 has waited at trx/trx0trx.c line 715 for 0.00 seconds the semaphore:
Mutex at 0x2aaab73db2b8 created file srv/srv0srv.c line 875, lock var 1
waiters flag 0
--Thread 1208592704 has waited at trx/trx0trx.c line 1578 for 0.00 seconds the semaphore:
Mutex at 0x2aaab73db2b8 created file srv/srv0srv.c line 875, lock var 1
waiters flag 0
--Thread 1302522176 has waited at trx/trx0trx.c line 715 for 0.00 seconds the semaphore:
Mutex at 0x2aaab73db2b8 created file srv/srv0srv.c line 875, lock var 1
waiters flag 0
--Thread 1345874240 has waited at trx/trx0trx.c line 715 for 0.00 seconds the semaphore:
Mutex at 0x2aaab73db2b8 created file srv/srv0srv.c line 875, lock var 1
waiters flag 0
--Thread 1228863808 has waited at btr/btr0cur.c line 443 for 2.00 seconds the semaphore:
S-lock on RW-latch at 0x2aae84684f30 created in file buf/buf0buf.c line 547
a writer (thread id 1180694848) has reserved it in mode exclusive
number of readers 0, waiters flag 1
Last time read locked in file not yet reserved line 0
Last time write locked in file buf/buf0buf.c line 1797
--Thread 1286064448 has waited at trx/trx0trx.c line 1578 for 0.00 seconds the semaphore:
Mutex at 0x2aaab73db2b8 created file srv/srv0srv.c line 875, lock var 1
waiters flag 0
--Thread 1345272128 has waited at trx/trx0trx.c line 986 for 0.00 seconds the semaphore:
Mutex at 0x2aaab73db2b8 created file srv/srv0srv.c line 875, lock var 1
waiters flag 0
--Thread 1266997568 has waited at trx/trx0trx.c line 1578 for 0.00 seconds the semaphore:
Mutex at 0x2aaab73db2b8 created file srv/srv0srv.c line 875, lock var 1
waiters flag 0
--Thread 1328011584 has waited at ../../storage/innobase/include/btr0btr.ic line 28 for 1.00 seconds the semaphore:
S-lock on RW-latch at 0x2aae847ad150 created in file buf/buf0buf.c line 547
a writer (thread id 1292286272) has reserved it in mode exclusive
number of readers 0, waiters flag 1
Last time read locked in file not yet reserved line 0
Last time write locked in file buf/buf0buf.c line 1797
--Thread 1238497600 has waited at btr/btr0cur.c line 443 for 10.00 seconds the semaphore:
S-lock on RW-latch at 0x2aae844a2ef0 created in file buf/buf0buf.c line 547
a writer (thread id 1254955328) has reserved it in mode exclusive
number of readers 0, waiters flag 1
Last time read locked in file not yet reserved line 0
Last time write locked in file buf/buf0buf.c line 1797
--Thread 1222842688 has waited at trx/trx0trx.c line 715 for 0.00 seconds the semaphore:
Mutex at 0x2aaab73db2b8 created file srv/srv0srv.c line 875, lock var 1
waiters flag 0
--Thread 1251342656 has waited at trx/trx0trx.c line 1578 for 0.00 seconds the semaphore:
Mutex at 0x2aaab73db2b8 created file srv/srv0srv.c line 875, lock var 0
waiters flag 0
--Thread 1253349696 has waited at trx/trx0trx.c line 986 for 0.00 seconds the semaphore:
Mutex at 0x2aaab73db2b8 created file srv/srv0srv.c line 875, lock var 0
waiters flag 0
wait has ended
--Thread 1206184256 has waited at trx/trx0trx.c line 1578 for 0.00 seconds the semaphore:
Mutex at 0x2aaab73db2b8 created file srv/srv0srv.c line 875, lock var 0
waiters flag 0
wait has ended
--Thread 1215416640 has waited at trx/trx0trx.c line 1578 for 0.00 seconds the semaphore:
Mutex at 0x2aaab73db2b8 created file srv/srv0srv.c line 875, lock var 0
waiters flag 0
wait has ended
--Thread 1280444736 has waited at trx/trx0trx.c line 715 for 0.00 seconds the semaphore:
Mutex at 0x2aaab73db2b8 created file srv/srv0srv.c line 875, lock var 0
waiters flag 0
wait has ended
--Thread 1242712384 has waited at trx/trx0trx.c line 1578 for 0.00 seconds the semaphore:
Mutex at 0x2aaab73db2b8 created file srv/srv0srv.c line 875, lock var 0
waiters flag 0
wait has ended
--Thread 1270008128 has waited at trx/trx0trx.c line 1578 for 0.00 seconds the semaphore:
Mutex at 0x2aaab73db2b8 created file srv/srv0srv.c line 875, lock var 0
waiters flag 0
wait has ended
--Thread 1298508096 has waited at btr/btr0cur.c line 443 for 9.00 seconds the semaphore:
S-lock on RW-latch at 0x2aae843a59f0 created in file buf/buf0buf.c line 547
a writer (thread id 1242110272) has reserved it in mode exclusive
number of readers 0, waiters flag 1
Last time read locked in file not yet reserved line 0
Last time write locked in file buf/buf0buf.c line 1797
--Thread 1345673536 has waited at btr/btr0cur.c line 443 for 16.00 seconds the semaphore:
S-lock on RW-latch at 0x2aae8444e9b0 created in file buf/buf0buf.c line 547
a writer (thread id 1252948288) has reserved it in mode exclusive
number of readers 0, waiters flag 1
Last time read locked in file not yet reserved line 0
Last time write locked in file buf/buf0buf.c line 1797
--Thread 1313360192 has waited at trx/trx0trx.c line 715 for 0.00 seconds the semaphore:
Mutex at 0x2aaab73db2b8 created file srv/srv0srv.c line 875, lock var 0
waiters flag 0
wait has ended
--Thread 1351293248 has waited at btr/btr0cur.c line 443 for 25.00 seconds the semaphore:
S-lock on RW-latch at 0x2aae84175ad0 created in file buf/buf0buf.c line 547
...全文
412 回复 打赏 收藏 转发到动态 举报
写回复
用AI写文章
回复
切换为时间正序
请发表友善的回复…
发表回复

56,678

社区成员

发帖
与我相关
我的任务
社区描述
MySQL相关内容讨论专区
社区管理员
  • MySQL
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧