Mysql服务正在消耗高达760%的CPU
我正在使用mysql 5.7。突然之间,MySQL服务器的CPU利用率非常高,RAM内存使用率也很高。DB命中率非常低。未启用慢速查询日志Mysql服务正在消耗高达760%的CPU,mysql,Mysql,我正在使用mysql 5.7。突然之间,MySQL服务器的CPU利用率非常高,RAM内存使用率也很高。DB命中率非常低。未启用慢速查询日志 Not sure what could be a issue.Please suggest how to fix this. Please find the innoDB status SHOW ENGINE INNODB STATUS\G; *************************** 1. row ************
Not sure what could be a issue.Please suggest how to fix this.
Please find the innoDB status
SHOW ENGINE INNODB STATUS\G;
*************************** 1. row ***************************
Type: InnoDB
Name:
Status:
=====================================
2020-01-03 14:25:49 0x7f2edcaa5700 INNODB MONITOR OUTPUT
=====================================
Per second averages calculated from the last 60 seconds
-----------------
BACKGROUND THREAD
-----------------
srv_master_thread loops: 124 srv_active, 0 srv_shutdown, 48 srv_idle
srv_master_thread log flush and writes: 172
----------
SEMAPHORES
----------
OS WAIT ARRAY INFO: reservation count 20222
OS WAIT ARRAY INFO: signal count 433962
RW-shared spins 0, rounds 102594, OS waits 6345
RW-excl spins 0, rounds 86040, OS waits 11766
RW-sx spins 471, rounds 10729, OS waits 182
Spin rounds per wait: 102594.00 RW-shared, 86040.00 RW-excl, 22.78 RW-sx
------------
TRANSACTIONS
------------
Trx id counter 644151905
Purge done for trx's n:o < 644151433 undo n:o < 0 state: running but idle
History list length 1674
LIST OF TRANSACTIONS FOR EACH SESSION:
---TRANSACTION 421330135615312, 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
200407 OS file reads, 5909 OS file writes, 3118 OS fsyncs
750.27 reads/s, 16384 avg bytes/read, 28.72 writes/s, 18.83 fsyncs/s
-------------------------------------
INSERT BUFFER AND ADAPTIVE HASH INDEX
-------------------------------------
Ibuf: size 1, free list len 4703, seg size 4705, 458 merges
merged operations:
insert 315, delete mark 387, delete 0
discarded operations:
insert 0, delete mark 0, delete 0
Hash table size 3718361, node heap has 732 buffer(s)
Hash table size 3718361, node heap has 1722 buffer(s)
Hash table size 3718361, node heap has 33 buffer(s)
Hash table size 3718361, node heap has 444 buffer(s)
Hash table size 3718361, node heap has 30318 buffer(s)
Hash table size 3718361, node heap has 591 buffer(s)
Hash table size 3718361, node heap has 1120 buffer(s)
Hash table size 3718361, node heap has 1760 buffer(s)
1183013.37 hash searches/s, 59626.41 non-hash searches/s
---
LOG
---
Log sequence number 1231417336087
Log flushed up to 1231417336087
Pages flushed up to 1231417336087
Last checkpoint at 1231417336078
0 pending log flushes, 0 pending chkp writes
1379 log i/o's done, 6.48 log i/o's/second
----------------------
BUFFER POOL AND MEMORY
----------------------
Total large memory allocated 15392047104
Dictionary memory allocated 4053431
Buffer pool size 917392
Free buffers 680532
Database pages 200140
Old database pages 74036
Modified db pages 0
Pending reads 0
Pending writes: LRU 0, flush list 0, single page 0
Pages made young 5, not young 0
0.00 youngs/s, 0.00 non-youngs/s
Pages read 200023, created 117, written 4266
0.00 reads/s, 0.00 creates/s, 0.00 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: 200140, unzip_LRU len: 0
I/O sum[0]:cur[2136], unzip sum[0]:cur[0]
----------------------
INDIVIDUAL BUFFER POOL INFO
----------------------
---BUFFER POOL 0
Buffer pool size 114674
Free buffers 84581
Database pages 25491
Old database pages 9429
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 25486, created 5, written 718
0.00 reads/s, 0.00 creates/s, 0.00 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: 25491, unzip_LRU len: 0
I/O sum[0]:cur[267], unzip sum[0]:cur[0]
---BUFFER POOL 1
Buffer pool size 114674
Free buffers 85011
Database pages 25079
Old database pages 9277
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 25078, created 1, written 329
0.00 reads/s, 0.00 creates/s, 0.00 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: 25079, unzip_LRU len: 0
I/O sum[0]:cur[267], unzip sum[0]:cur[0]
---BUFFER POOL 2
Buffer pool size 114674
Free buffers 84531
Database pages 25554
Old database pages 9453
Modified db pages 0
Pending reads 0
Pending writes: LRU 0, flush list 0, single page 0
Pages made young 1, not young 0
0.00 youngs/s, 0.00 non-youngs/s
Pages read 25550, created 4, written 386
0.00 reads/s, 0.00 creates/s, 0.00 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: 25554, unzip_LRU len: 0
I/O sum[0]:cur[267], unzip sum[0]:cur[0]
---BUFFER POOL 3
Buffer pool size 114674
Free buffers 84508
Database pages 25577
Old database pages 9461
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 25524, created 53, written 597
0.00 reads/s, 0.00 creates/s, 0.00 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: 25577, unzip_LRU len: 0
I/O sum[0]:cur[267], unzip sum[0]:cur[0]
---BUFFER POOL 4
Buffer pool size 114674
Free buffers 86213
Database pages 23876
Old database pages 8833
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 23873, created 3, written 515
0.00 reads/s, 0.00 creates/s, 0.00 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: 23876, unzip_LRU len: 0
I/O sum[0]:cur[267], unzip sum[0]:cur[0]
---BUFFER POOL 5
Buffer pool size 114674
Free buffers 85724
Database pages 24365
Old database pages 9014
Modified db pages 0
Pending reads 0
Pending writes: LRU 0, flush list 0, single page 0
Pages made young 2, not young 0
0.00 youngs/s, 0.00 non-youngs/s
Pages read 24316, created 49, written 701
0.00 reads/s, 0.00 creates/s, 0.00 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: 24365, unzip_LRU len: 0
I/O sum[0]:cur[267], unzip sum[0]:cur[0]
---BUFFER POOL 6
Buffer pool size 114674
Free buffers 84226
Database pages 25855
Old database pages 9564
Modified db pages 0
Pending reads 0
Pending writes: LRU 0, flush list 0, single page 0
Pages made young 2, not young 0
0.00 youngs/s, 0.00 non-youngs/s
Pages read 25853, created 2, written 521
0.00 reads/s, 0.00 creates/s, 0.00 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: 25855, unzip_LRU len: 0
I/O sum[0]:cur[267], unzip sum[0]:cur[0]
---BUFFER POOL 7
Buffer pool size 114674
Free buffers 85738
Database pages 24343
Old database pages 9005
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 24343, created 0, written 499
0.00 reads/s, 0.00 creates/s, 0.00 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: 24343, unzip_LRU len: 0
I/O sum[0]:cur[267], unzip sum[0]:cur[0]
--------------
ROW OPERATIONS
--------------
0 queries inside InnoDB, 0 queries in queue
4 read views open inside InnoDB
Process ID=17561, Main thread ID=139839359936256, state: sleeping
Number of rows inserted 18536, updated 78, deleted 130, read 185651761
46.90 inserts/s, 0.50 updates/s, 1.05 deletes/s, 1648120.55 reads/s
----------------------------
END OF INNODB MONITOR OUTPUT
=========================
附加信息请求。RAM大小、#内核、MySQL主机服务器上的任何SSD设备?在pastebin.com上发布并共享链接。A) 从SSH登录根目录中完成(未编辑)my.cnf或my.ini,文本结果为:B)显示全局状态;至少24小时正常运行后C)显示全局变量;D) 显示完整的进程列表;E) 完整的MySQLTuner报告和可选的非常有用的信息,如果有的话,包括-ulimit-a(用于Linux/Unix限制列表)、iostat-xm 5 3(用于按设备和核心/cpu计数划分的IOPS),用于服务器工作负载优化分析以提供建议。慢速查询日志是您能找到的最好的朋友之一。使用log\u output=FILE、slow\u query\u log=1、long\u query\u time=5秒启用它。每周只纠正一个常用的查询将是有益的。
procs -----------memory---------- ---swap-- -----io---- --system-- -----cpu-----
r b swpd free buff cache si so bi bo in cs us sy id wa st
18 0 67756 175424 144072 10294832 0 1 307 90 67 184 35 1 61 3 0
22 0 67756 175152 144072 10294860 0 0 0 240 9482 10164 94 1 5 0 0
4 0 67756 174408 144072 10294876 0 0 0 76 9538 11227 93 1 6 0 0
20 0 67756 173292 144080 10294892 0 0 16 488 9785 11370 94 1 6 0 0
15 0 67756 172548 144084 10294928 0 0 16 228 9550 10906 95 1 4 0 0
16 0 67756 171060 144084 10294940 0 0 0 0 9059 10031 93 1 6 0 0
10 0 67756 176268 144096 10294928 0 0 0 276 9489 10208 92 1 7 0 0
15 0 67756 175772 144096 10294972 0 0 0 284 8886 8658 94 1 6 0 0
15 1 67756 174904 144100 10294976 0 0 0 6412 9815 11459 92 1 6 0 0
23 0 67756 174160 144108 10295228 0 0 0 272 9338 9683 95 1 4 0 0