Sorry for the title of the question, here's my problem: I've been trying to set up some scripts that import a lot of stuff hourly from an external source. They seemed to work fine, so I set up a cronjob to run them every hour. One day later I find six or seven instances of that script just hogging the MySQL server, making it unresponsive. I killed their processes, but MySQL was still not responding. I had to kill MySQL, reboot and then MySQL started working again (who knows on what) and being unresponsive (yes, I did remove the scripts from the cronjobs). I SHOW PROCESSLISTed and killed every process I could find. Still nothing, MySQL is hogging the HDD and is at the top of top and making the server load go up in the sky. I don't know what to do, if I kill and start it again it will probably do the same thing. What should I do?

  • What table types are you using? – mbac32768 Apr 2 '10 at 12:18
  • MyISAM and InnoDB – Felix Apr 2 '10 at 12:46
  • Please post the cron entry and the essence of the script. – wallyk Apr 2 '10 at 15:52
  • @wallyk I was running the MB_MySQL project (MusicBrainz Database for MySQL -- google it) and had update.pl in the cron (set to run every hour at :30 minutes). – Felix Apr 2 '10 at 18:54

You DB is doing exactly what it is supposed to do. When a transaction gets killed, it needs to be rolled back. You can not stop it if you want a consistent database.

If this is not important for you, kill MySQL and create a whole new DB from scratch beacuse this one will never work again unless you let the rollback finish.

A suggestion for the cron jobs, make the first thing you do in the job is to check if you are still running from the previous time, and if so, exit. Make sure you have it logging what is happening so you can adjust the time between runs to a better value.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.