Kill sleeping MySQL connections via shell.

Some servers may have a bug involving the MySQL version and Linux kernel versions used. In these cases some sites may generate sleeping mysql connections that do not die despite proper my.cnf configuration. There may be thousands of such connections after weeks of use. Eventually the performance is impacted though the connections are sleeping. A temporary solution would be to routinely kill sleeping connections.

for i in `mysqladmin proc | grep Sleep | awk '{print $2}'`; do mysqladmin kill $i; done

Tags: , ,

2 Responses to “Kill sleeping MySQL connections via shell.”

  1. LUIS says:


    MedicamentSpot.com. Canadian Health&Care.Best quality drugs.No prescription online pharmacy.Special Internet Prices. Low price drugs. Order pills online

    Buy:Advair.Wellbutrin SR.Lipothin.Acomplia.Lipitor.Prozac.SleepWell.Female Pink Viagra.Lasix.Amoxicillin.Zocor.Female Cialis.Aricept.Buspar.Benicar.Zetia.Cozaar.Nymphomax.Seroquel.Ventolin….

Leave a Reply