论坛版本是dz7.0正式版,数据库500多M, 以前使用得好好的,这段时间流量增加了一些,站长统计到的15分钟在线在500左右.cpu就时不时的100%.
查看进程,w3wp.exe这个进程时不时吃了cpu100%
网上找了很多方法,也给数据库安装了索引.但都无效,只有开启二次请求后,CPU会好一些,不会升太高上去.
按照说明开启了日志慢查询,帮忙分析下看看是什么情况,下面只附了最新的一部分上来.都是慢于2秒的,如果需要可以附上更多日志!
LIMIT 26;
# Time: 090824 10:30:50
# User@Host: sq_qqtbw[sq_qqtbw] @ localhost [127.0.0.1]
# Query_time: 6 Lock_time: 0 Rows_sent: 1 Rows_examined: 799
use sq_qqtbw;
SELECT count(*) FROM `sq_qqtbw`.uc_pms WHERE (related='0' AND msgfromid>'0' OR msgfromid='0') AND msgtoid='4254' AND folder='inbox' AND new='1';
# Time: 090824 10:58:14
# User@Host: 66230[66230] @ localhost [127.0.0.1]
# Query_time: 8 Lock_time: 0 Rows_sent: 1 Rows_examined: 4720
use 66230;
select count(*) as total from phome_enewsgbook where bid='1' and checked=0;
# Time: 090824 11:01:03
# User@Host: fz60[fz60] @ localhost [127.0.0.1]
# Query_time: 4 Lock_time: 0 Rows_sent: 10 Rows_examined: 1350
use fz60;
SELECT p.*, m.uid, m.username, m.groupid, m.adminid, m.regdate, m.lastactivity, m.posts, m.digestposts, m.oltime,
m.pageviews, m.credits, m.extcredits1, m.extcredits2, m.extcredits3, m.extcredits4, m.extcredits5, m.extcredits6,
m.extcredits7, m.extcredits8, m.email, m.gender, m.showemail, m.invisible, mf.nickname, mf.site,
mf.icq, mf.qq, mf.yahoo, mf.msn, mf.taobao, mf.alipay, mf.location, mf.medals,
mf.sightml AS signature, mf.customstatus, mf.spacename
FROM cdb_posts p
LEFT JOIN cdb_members m ON m.uid=p.authorid
LEFT JOIN cdb_memberfields mf ON mf.uid=m.uid
WHERE p.tid='77334'AND p.invisible='0' ORDER BY dateline LIMIT 440, 10;
# Time: 090824 11:04:18
# User@Host: sq_qqtbw[sq_qqtbw] @ localhost [127.0.0.1]
# Query_time: 5 Lock_time: 0 Rows_sent: 4 Rows_examined: 1482
use sq_qqtbw;
SELECT p.*, m.uid, m.username, m.groupid, m.adminid, m.regdate, m.lastactivity, m.posts, m.digestposts, m.oltime,
m.pageviews, m.credits, m.extcredits1, m.extcredits2, m.extcredits3, m.extcredits4, m.extcredits5, m.extcredits6,
m.extcredits7, m.extcredits8, m.email, m.gender, m.showemail, m.invisible, mf.nickname, mf.site,
mf.icq, mf.qq, mf.yahoo, mf.msn, mf.taobao, mf.alipay, mf.location, mf.medals,
mf.sightml AS signature, mf.customstatus, mf.spacename , mf.field_1
FROM cdb_posts p
LEFT JOIN cdb_members m ON m.uid=p.authorid
LEFT JOIN cdb_memberfields mf ON mf.uid=m.uid
WHERE p.tid='16427'AND p.invisible='0' ORDER BY dateline LIMIT 490, 10;
# User@Host: sq_qqtbw[sq_qqtbw] @ localhost [127.0.0.1]
# Query_time: 5 Lock_time: 0 Rows_sent: 4 Rows_examined: 1482
SELECT p.*, m.uid, m.username, m.groupid, m.adminid, m.regdate, m.lastactivity, m.posts, m.digestposts, m.oltime,
m.pageviews, m.credits, m.extcredits1, m.extcredits2, m.extcredits3, m.extcredits4, m.extcredits5, m.extcredits6,
m.extcredits7, m.extcredits8, m.email, m.gender, m.showemail, m.invisible, mf.nickname, mf.site,
mf.icq, mf.qq, mf.yahoo, mf.msn, mf.taobao, mf.alipay, mf.location, mf.medals,
mf.sightml AS signature, mf.customstatus, mf.spacename , mf.field_1
FROM cdb_posts p
LEFT JOIN cdb_members m ON m.uid=p.authorid
LEFT JOIN cdb_memberfields mf ON mf.uid=m.uid
WHERE p.tid='16427'AND p.invisible='0' ORDER BY dateline LIMIT 490, 10;
# Time: 090824 11:04:19
# User@Host: sq_qqtbw[sq_qqtbw] @ localhost [127.0.0.1]
# Query_time: 4 Lock_time: 0 Rows_sent: 6 Rows_examined: 1128
SELECT p.*, m.uid, m.username, m.groupid, m.adminid, m.regdate, m.lastactivity, m.posts, m.digestposts, m.oltime,
m.pageviews, m.credits, m.extcredits1, m.extcredits2, m.extcredits3, m.extcredits4, m.extcredits5, m.extcredits6,
m.extcredits7, m.extcredits8, m.email, m.gender, m.showemail, m.invisible, mf.nickname, mf.site,
mf.icq, mf.qq, mf.yahoo, mf.msn, mf.taobao, mf.alipay, mf.location, mf.medals,
mf.sightml AS signature, mf.customstatus, mf.spacename , mf.field_1
FROM cdb_posts p
LEFT JOIN cdb_members m ON m.uid=p.authorid
LEFT JOIN cdb_memberfields mf ON mf.uid=m.uid
WHERE p.tid='74074'AND p.invisible='0' ORDER BY dateline LIMIT 370, 10; |