![]() |
Code To Auto Killall Mysqld
Im looking for a command that will check my server load and run the command 'killall mysqld' if the load is over a certain average. Should I be looking for cron commands to do this?
|
I would suggest you better check why the mysql load moves that high and find a solution for this or better fix the program which makes the server load :)
|
I wouldn't condone doing a kill for that as you're likely to leave tables in a crashed state requiring a repair or at least a check before you start.
However, with that said, you could do something like: Code:
#!/usr/bin/perl Perhaps run something like mysqladmin -uroot -ppassword processlist | mail username@domain.com or turn on the slow query log, or do a show processlist in the mysql command line interface or phpmyadmin. Better to find the cause than to treat the effect. |
All times are GMT -4. The time now is 04:52 AM. |
Powered by vBulletin® Version 3.8.1
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
© Greenguy Marketing Inc