- 论坛徽章:
- 0
|
64位centos系统.
现象:每天有1-2次 数据库Sleep线程特别多,多的时候到200, 多的时候 页面访问就会慢.
平时很快.基本show 不超过10个查询.
show processlist;如下 请高手给点解决办法和排查思路:
| 4411958 | mysql | 192.168.1.23:59688 | dz_bbs | Sleep | 37 | | NULL |
| 4411993 | mysql | 192.168.1.23:59736 | dz_bbs | Sleep | 35 | | NULL |
| 4411994 | mysql | 192.168.1.23:59737 | dz_bbs | Sleep | 35 | | NULL |
| 4411995 | mysql | 192.168.1.23:59738 | dz_bbs | Sleep | 35 | | NULL |
| 4411997 | mysql | 192.168.1.23:59740 | dz_bbs | Sleep | 35 | | NULL |
| 4411996 | mysql | 192.168.1.23:59739 | dz_bbs | Sleep | 35 | | NULL |
| 4411998 | mysql | 192.168.1.23:59741 | dz_bbs | Sleep | 35 | | NULL |
| 4411999 | mysql | 192.168.1.23:59742 | dz_bbs | Sleep | 35 | | NULL |
| 4412000 | mysql | 192.168.1.23:59743 | dz_bbs | Sleep | 35 | | NULL |
| 4412004 | mysql | 192.168.1.23:59750 | dz_bbs | Sleep | 35 | | NULL |
| 4412007 | mysql | 192.168.1.23:59754 | dz_bbs | Sleep | 34 | | NULL |
| 4412008 | mysql | 192.168.1.23:59755 | dz_bbs | Sleep | 34 | | NULL |
| 4412009 | mysql | 192.168.1.23:59758 | dz_bbs | Sleep | 34 | | NULL |
| 4412046 | mysql | 192.168.1.23:59815 | dz_bbs | Sleep | 27 | | NULL |
| 4412047 | mysql | 192.168.1.23:59816 | dz_bbs | Sleep | 32 | | NULL |
| 4412048 | mysql | 192.168.1.23:59817 | dz_bbs | Sleep | 32 | | NULL |
| 4412084 | mysql | 192.168.1.23:59863 | dz_bbs | Sleep | 25 | | NULL |
| 4412094 | mysql | 192.168.1.23:59869 | dz_bbs | Sleep | 30 | | NULL |
| 4412106 | mysql | 192.168.1.23:59877 | dz_bbs | Sleep | 29 | | NULL |
| 4412107 | mysql | 192.168.1.23:59878 | dz_bbs | Sleep | 29 | | NULL |
| 4412134 | mysql | 192.168.1.23:59910 | dz_bbs | Sleep | 28 | | NULL |
| 4412155 | mysql | 192.168.1.23:59942 | dz_bbs | Sleep | 27 | | NULL |
| 4412164 | mysql | 192.168.1.23:59958 | dz_ucenter | Sleep | 27 | | NULL |
| 4412174 | mysql | 192.168.1.23:59982 | dz_bbs | Sleep | 26 | | NULL |
| 4412188 | mysql | 192.168.1.23:59994 | dz_bbs | Sleep | 25 | | NULL |
| 4412191 | mysql | 192.168.1.23:59998 | dz_bbs | Sleep | 25 | | NULL |
| 4412194 | mysql | 192.168.1.23:60002 | dz_ucenter | Sleep | 25 | | NULL |
| 4412237 | mysql | 192.168.1.23:60061 | dz_bbs | Sleep | 23 | | NULL |
| 4412247 | mysql | 192.168.1.23:60073 | dz_bbs | Sleep | 23 | | NULL |
| 4412250 | mysql | 192.168.1.23:60078 | dz_bbs | Sleep | 23 | | NULL |
| 4412253 | mysql | 192.168.1.23:60083 | dz_bbs | Sleep | 23 | | NULL |
| 4412269 | mysql | 192.168.1.23:60105 | dz_bbs | Sleep | 21 | | NULL |
| 4412276 | mysql | 192.168.1.23:60114 | dz_bbs | Sleep | 20 | | NULL |
| 4412278 | mysql | 192.168.1.23:60116 | dz_bbs | Sleep | 20 | | NULL |
| 4412279 | mysql | 192.168.1.23:60117 | dz_bbs | Sleep | 20 | | NULL |
| 4412280 | mysql | 192.168.1.23:60118 | dz_bbs | Sleep | 20 | | NULL |
| 4412302 | mysql | 192.168.1.23:60144 | dz_bbs | Sleep | 19 | | NULL |
| 4412305 | mysql | 192.168.1.23:60148 | dz_bbs | Sleep | 19 |
mysqlreport结果:
MySQL 5.0.51a-log uptime 3 13:42:39 Thu Dec 4 09:43:26 2008
__ Key _________________________________________________________________
Buffer used 258.14M of 1.17G %Used: 21.51
Current 430.31M %Usage: 35.86
Write hit 81.51%
Read hit 99.96%
__ Questions ___________________________________________________________
Total 41.70M 135.1/s
DMS 16.47M 53.4/s %Total: 39.51
Com_ 14.42M 46.7/s 34.58
COM_QUIT 5.82M 18.8/s 13.95
QC Hits 4.98M 16.1/s 11.93
+Unknown 9.00k 0.0/s 0.02
Slow 4 s 1.53M 5.0/s 3.68 %DMS: 9.31 Log: ON
DMS 16.47M 53.4/s 39.51
SELECT 7.88M 25.6/s 18.91 47.86
UPDATE 4.19M 13.6/s 10.04 25.40
INSERT 1.85M 6.0/s 4.43 11.22
DELETE 1.48M 4.8/s 3.54 8.95
REPLACE 1.08M 3.5/s 2.59 6.56
Com_ 14.42M 46.7/s 34.58
set_option 9.23M 29.9/s 22.15
change_db 5.17M 16.8/s 12.41
show_status 5.32k 0.0/s 0.01
__ SELECT and Sort _____________________________________________________
Scan 77.00k 0.2/s %SELECT: 0.98
Range 588.62k 1.9/s 7.47
Full join 0 0/s 0.00
Range check 0 0/s 0.00
Full rng join 0 0/s 0.00
Sort scan 57.31k 0.2/s
Sort range 296.54k 1.0/s
Sort mrg pass 4.61k 0.0/s
__ Query Cache _________________________________________________________
Memory usage 23.33M of 256.00M %Used: 9.11
Block Fragmnt 24.00%
Hits 4.98M 16.1/s
Inserts 7.80M 25.3/s
Insrt rune 7.80M:1 25.3/s
Hit:Insert 0.64:1
__ Table Locks _________________________________________________________
Waited 142.25k 0.5/s %Total: 0.67
Immediate 21.16M 68.6/s
__ Tables ______________________________________________________________
Open 2029 of 2048 %Cache: 99.07
Opened 2.63k 0.0/s
__ Connections _________________________________________________________
Max used 501 of 500 %Max: 100.20
Total 5.82M 18.9/s
__ Created Temp ________________________________________________________
Disk table 1.58k 0.0/s
Table 36.40k 0.1/s Size: 256.0M
File 7.50k 0.0/s
__ Threads _____________________________________________________________
Running 2 of 3
Cached 126 of 128 %Hit: 99.94
Created 3.23k 0.0/s
Slow 0 0/s
__ Aborted _____________________________________________________________
Clients 1.30k 0.0/s
Connects 1.44k 0.0/s
__ Bytes _______________________________________________________________
Sent 52.39G 169.8k/s
Received 4.95G 16.1k/s
__ InnoDB Buffer Pool __________________________________________________
Usage 16.61M of 256.00M %Used: 6.49
Read hit 97.64%
Pages
Free 15.32k %Total: 93.51
Data 1.06k 6.49 %Drty: 0.09
Misc 0 0.00
Latched 0 0.00
Reads 30.30k 0.1/s
From file 716 0.0/s 2.36
Ahead Rnd 7 0.0/s
Ahead Sql 0 0/s
Writes 1 0.0/s
Flushes 0 0/s
Wait Free 0 0/s
__ InnoDB Lock _________________________________________________________
Waits 0 0/s
Current 0
Time acquiring
Total 0 ms
Average 0 ms
Max 0 ms
__ InnoDB Data, Pages, Rows ____________________________________________
Data
Reads 786 0.0/s
Writes 4 0.0/s
fsync 4 0.0/s
Pending
Reads 0
Writes 0
fsync 0
Pages
Created 0 0/s
Read 1.06k 0.0/s
Written 0 0/s
Rows
Deleted 0 0/s
Inserted 0 0/s
Read 17 0.0/s
Updated 0 0/s |
|