SQL hanging

Hi,

I have a rather strange issue with MySQL on my dedicated. The server is rather active (a dual Xeon with 1GB RAM), but every now and then the SQL just hangs and the process is just running and running. This is hogging lots of CPU and the SQL is not responding.

Only way to fix this is to log into the server via SSH and do a kill -9 on the SQL process. This happens a few time per week and is starting to get a bit annoying. Is there any way that I could :

a) Make a cron-job / script that does a kill -9 on the MySQL job if it's been running for more than XX seconds.

b) Limit the ammount of time each SQL job is allowed to run


What would you guys suggest I do? What options do I have?

 

 

 

 

Top