开发者

MySql, why would my site be hitting 100% CPU when pages loads quickly?

I'm trying to figure out possible reasons why my database could be causing 100% CPU time.

Its been like this for a while even 开发者_JS百科though I've recently made changes so that pages / queries run much faster.

Heres a video my ISP produced of my site, showing the CPU usage.

Heres some questions I asked my ISP..

Me : would you say its a fast server ?
ISP: yeah it has 4 cpu cores lol and 3.5gb ram
ISP: 4 x intel xeon's 3.4ghz it has
ISP: its also running raid 5 on ultra scsi 320 drivers
Me : what the mysql caching settings ?
ISP: which handles 320 mb/s
ISP: hmm maybe the mysql cache is low
ISP: have emailed it to you. 
Me : was it low ?
ISP: if you do post for advice one thing to mention is that this 
  is not a dedicated mysql server
ISP: so it can't be setup to use the server maximum resources

Heres the My.ini he sent me a copy...

Also heres my phpMyAdmin status page. I think I'm right in saying that theres nothing in the slow log, I think the slow queries is from before my fixes.


Considering that your long_query time is set to 2, and it looks like there are multiple queries firing per page, but returning reasonably quickly, no wonder you don't know what's slow. (NB you can override this within your code to record more detailled information for the session).

You've not said if this is a dedicated database server or if its running other stuff. Nor is there anything in the video to suggest that the CPU is a direct consequence of mysql (compared, say with a badly configured AV scanner).

There are a whole lot of potential causes, but with a MSWindows platform, its very difficult to diagnose most of them, and even less scope for actually fixing a lot of them.

But if you're happy with the time it takes for the pages to be generated, why do you care about CPU usage?

Its also interesting to note that you've got approx twice as many change db ops as select ops - suggests your data has been split across 2 databases?


Maybe you'll find something usefull for you here mysql-high-cpu-usage

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜