| Author |
Message |
ayaz
Joined: 12 Jul 2008
Posts: 4
|
| Posted: Sat Jul 12, 2008 4:18 am Post subject: mysqld hogging CPU like crazy |
|
|
Running a CentOS-5.0 image on a Linode 540 on the Atlanta DC (atlanta43). mysqld is hogging CPU like crazy. Consuming anywhere from 99% to 250% (or more) CPU has now become the norm for mysqld. I have tried all mysql optimisation tricks I could find. No relief. I've also cut down the limit on processes Apache can spawn to serve requests. Persistent connections is enabled. I am simply stumped.
A while back the Linode crashed when the kernel invoked the oom-killer. The oom-killer, trying to reclaim memory, took down the entire system. Not completely sure whether it has happened again since that time, but I'm ripping my way through logs.
Clues, suggestions? I'd really appreciate any I can get. Thanks!
--
Ayaz Ahmed Khan |
|
| Back to top |
|
josephb
Joined: 20 May 2008
Posts: 8
|
| Posted: Sat Jul 12, 2008 4:38 am Post subject: Re: mysqld hogging CPU like crazy |
|
|
ayaz wrote:
Clues, suggestions? I'd really appreciate any I can get. Thanks!
Is mysql going crazy or are your sites just being hit hard? |
|
| Back to top |
|
Wizzard
Joined: 23 Jun 2008
Posts: 12
|
| Posted: Sat Jul 12, 2008 7:36 am Post subject: |
|
|
You enabled and checked the slow query log, also enabled the queries with no index's log?
Just takes 1 query to slow the whole boat down.... |
|
| Back to top |
|
Wizzard
Joined: 23 Jun 2008
Posts: 12
|
| Posted: Sat Jul 12, 2008 7:36 am Post subject: |
|
|
| Also you looked into and properly using the mysql cache? |
|
| Back to top |
|
ayaz
Joined: 12 Jul 2008
Posts: 4
|
| Posted: Sat Jul 12, 2008 11:01 am Post subject: Re: mysqld hogging CPU like crazy |
|
|
josephb wrote:
Is mysql going crazy or are your sites just being hit hard?
The website gets traffic, but I wouldn't call it _heavy_. On average, it receives around 43K hits per day. There is nothing else running. The system serves a standard WordPress installation.
I don't know why but mysqld shouldn't be claiming that much CPU that much of the time. Have I bumped into a limitation of the Linode/Xen?
--
Ayaz Ahmed Khan |
|
| Back to top |
|
anderiv
Joined: 27 Apr 2004
Posts: 127
|
| Posted: Sat Jul 12, 2008 11:08 am Post subject: Re: mysqld hogging CPU like crazy |
|
|
ayaz wrote: The system serves a standard WordPress installation.
Are you running the WP-Super-Cache plugin? If not, you certainly *should* be. It's one of the few "standard" plugins I require people run if they're using WP on my server. |
|
| Back to top |
|
ayaz
Joined: 12 Jul 2008
Posts: 4
|
| Posted: Sat Jul 12, 2008 11:14 am Post subject: |
|
|
Wizzard wrote: You enabled and checked the slow query log, also enabled the queries with no index's log?
Just takes 1 query to slow the whole boat down....
Also you looked into and properly using the mysql cache?
Thanks. Yup, all that you mention is enabled and running, except the 'no index log' part. I'll follow up with that.
--
Ayaz Ahmed Khan |
|
| Back to top |
|
ayaz
Joined: 12 Jul 2008
Posts: 4
|
| Posted: Sat Jul 12, 2008 11:18 am Post subject: Re: mysqld hogging CPU like crazy |
|
|
anderiv wrote: Are you running the WP-Super-Cache plugin? If not, you certainly *should* be. It's one of the few "standard" plugins I require people run if they're using WP on my server.
Thanks, Anderiv. Not the WP-Super-Cache plugin, but WP-Cache is plugged in. Also, the static content from WP has been moved such that it is now being served by another host altogether (not part of the Linode). This was done desperately in the hopes that the CPU usage may stablise. But, no dice.
--
Ayaz Ahmed Khan |
|
| Back to top |
|
josephb
Joined: 20 May 2008
Posts: 8
|
| Posted: Sun Jul 13, 2008 5:35 am Post subject: Re: mysqld hogging CPU like crazy |
|
|
ayaz wrote:
The website gets traffic, but I wouldn't call it _heavy_. On average, it receives around 43K hits per day. There is nothing else running. The system serves a standard WordPress installation.
One of the sites I host has 150k uniques and 2million hits a month, my Linode 540 doesn't even blink.
I'd be enabling some mysql caching, and query logging to see where things are going wrong. |
|
| Back to top |
|
pdepartida
Joined: 12 May 2008
Posts: 4
|
| Posted: Sun Jul 13, 2008 8:19 pm Post subject: Re: mysqld hogging CPU like crazy |
|
|
ayaz wrote:
Have I bumped into a limitation of the Linode/Xen?
--
Ayaz Ahmed Khan
Don't think so. I run a site on the same server, atlanta43 and heavily use a table that has up to 1'500,000 uniques. I will probably get around 4k hits per day. The 540 linode, same as said by josephb, doesn't "even blink". You are missing something. This is surely not a mysql or Linode/Xen bug nor a specific problem with atlanta43. |
|
| Back to top |
|
Internat
Joined: 17 Aug 2004
Posts: 172
Location: Brisbane, Australia
|
| Posted: Mon Jul 14, 2008 12:31 am Post subject: |
|
|
| Id be interested to see the my.cnf and apache/http configs for those of you that said you get 10k+ hits a day.. Just for my own corisoty, to see how yours is optimised vs mine :) |
|
| Back to top |
|
oliver
Joined: 02 Apr 2008
Posts: 16
|
| Posted: Mon Jul 14, 2008 11:44 am Post subject: |
|
|
search the mysql bug database.
i remember reading about this problem a while ago where a buggy startup script would make mysqld spin the CPU at 100%.
i don't have a link right now, will update this thread if i find it. |
|
| Back to top |
|
wraith4
Joined: 06 Oct 2008
Posts: 1
|
| Posted: Mon Oct 06, 2008 6:35 am Post subject: |
|
|
same here, using Debian Etch :(
Edit: fixed - It was because of crazy mysql query in WordPress plugin.
Fixed at 20h :oops: ..what can make one DISTINCT :) |
|
| Back to top |
|
| |