MySQL to blame? (was Re: [PHP] Command-line PHP script CPU usage goes sky-high, stays there--why?)
| From: | M5 | Date: | Thu, 20 Dec 2007 15:48:02 +0000 |
| Subject: | MySQL to blame? (was Re: [PHP] Command-line PHP script CPU usage goes sky-high, stays there--why?) | ||
| References: | 1 2 3 4 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-266164@lists.php.net to get a copy of this message | ||
On 20-Dec-07, at 1:17 AM, Per Jessen wrote:
René Fournier wrote:I have, and I can't see anything unusual. There are a few scripts that loop with very slow overhead (with sufficient sleep(), etc.) plus a few outside HTTP requests. Nothing unusual. Incidentally, yesterday, when MySQL went to 80-90% again after a week, I let it stay there while I poked around MySQL (doing the above) and the OS to see if there are some magical limit that I might be breaking. So it the server ran with MySQL at 80-90% CPU for about eight hours. Everything still worked fine, scripts ran, the database was available. That's the thing about this problem--it's not a show-stopper, it's just really strange. And I can't figure its source. After not finding anything, I decided restart the script. So I stop the [seemingly offending] script and wait for CPU load to return to normal. It doesn't. MySQL remains at 80-90%. Even with all the other processes turned off that call MySQL and Web Server off, MySQL remains at 80-90%. Yet SHOW PROCESSES lists no processes, just the "show processlist" command I issue. With the load still high, I attempted to "Stop" MySQL via the Adminstrator control panel. I waited a few minutes. It doesn't shutdown. Finally--and I really hate doing this, because it sees dangerous to data (is it?)--I issue a kill -9 command to its process. Then it starts fine, I start the script in question, and everything is back to normal. ...ReneI'm really not sure what to try next. ps -aux shows MySQL as hogging the CPU, not PHP or Terminal:When this happens, do a 'SHOW PROCESSLIST' in mysql to see what it's doing.