Avr 192012
 

Créez ce script et lancez le régulièrement avec un cron :

#!/bin/bash
 
USER=root
PASS=XXXXXX
TIME=120
mysql=/usr/bin/mysql
grep=/bin/grep
mysqladmin=/usr/bin/mysqladmin
 
## KILL SLEEP > $TIME
for requete in $($mysql -u$USER -p$PASS INFORMATION_SCHEMA -B -e'select id from PROCESSLIST where Command like "Sleep" and TIME >= "'$TIME'"'| $grep -v id); do 
       $mysqladmin -u$USER -p$PASS kill $requete 
done
 
## KILL SELECT > $TIME
for requete in $($mysql -u$USER -p$PASS INFORMATION_SCHEMA -B -e'select id from PROCESSLIST where INFO like "select%" and TIME >= "'$TIME'"'| $grep -v id); do 
       $mysqladmin -u$USER -p$PASS kill $requete 
done

 Leave a Reply

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong> <pre lang="" line="" escaped="" cssfile="">

(required)

(required)

Spam protection by WP Captcha-Free