Hi Michael:

Yeah , i think that i do a shell script.something like that.

    require 'mysql'

    mysql = Mysql.new(ip, user, pass)
    processlist = mysql.query("show full processlist")
    killed = 0
    processlist.each { | process |
      mysql.query("KILL #{process[0].to_i}")
    }
    puts "#{Time.new} -- killed: #{killed} connections"



2011/2/17 Michael Dykman <mdyk...@gmail.com>

> from the mysql console:  > show processlist
> this will show you ids of all active connections, even the dead ones
>
> then, again form the console  > kill <processid>
>
> On Thu, Feb 17, 2011 at 3:52 PM, Rafael Valenzuela <rav...@gmail.com>
> wrote:
> > Hi all;
> > I wonder if there is any tool to Performance Tuning querys. In other know
> if
> > there is any way to kill connections that take x hours dead (for example
> 1
> > hour)
> >
> > --
> > Mit forever
> > My Blog <http://www.redcloverbi.wordpress.com>
> > My Faborite Web<
> http://ocw.mit.edu/OcwWeb/Electrical-Engineering-and-Computer-Science/index.htm
> >
> > http://www.technologyreview.com/
> >
>
>
>
> --
>  - michael dykman
>  - mdyk...@gmail.com
>
>  May the Source be with you.
>



-- 
Mit forever
My Blog <http://www.redcloverbi.wordpress.com>
My Faborite 
Web<http://ocw.mit.edu/OcwWeb/Electrical-Engineering-and-Computer-Science/index.htm>
http://www.technologyreview.com/

Reply via email to