Created
February 5, 2014 09:53
-
-
Save vicendominguez/8820342 to your computer and use it in GitHub Desktop.
massive-kill for mysql sleep connections (concept)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#This is a bullshit but... i will kill all the sleep connections which sleeping time starting with 8 | |
for a in `echo "show processlist" |mysql --user=root --password=tete coredb |egrep 'Sleep[[:space:]]+8[[:digit:]]+' |awk '{ print $1 }'`; do echo "KILL $a" | mysql --user=root --password=tete coredb; done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment