Skip to content

Instantly share code, notes, and snippets.

@vicendominguez
Created February 5, 2014 09:53
Show Gist options
  • Save vicendominguez/8820342 to your computer and use it in GitHub Desktop.
Save vicendominguez/8820342 to your computer and use it in GitHub Desktop.
massive-kill for mysql sleep connections (concept)
#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