How We Kill mysql sleep processes Like:
+------+-----------+-----------+------------------------+---------+------+----------------+-----------------------------------
Percona Tools:
pt-kill --match-command Sleep --idle-time 100 --victims all --interval 30 --kill
This will find all connections that are "Sleep" state and idle for 100 seconds or more and kill them. --interval 30 will make it keep do this every 30 seconds. So you can open a screen -S ptkill then in that screen run the above command, then ctrl-A, D to detach and exit the terminal and it will just keep running cleaning up your connections.
https://www.percona.com/doc/percona-toolkit/2.1/pt-kill.html