List:General Discussion« Previous MessageNext Message »
From:Rafael Valenzuela Date:February 17 2011 9:16pm
Subject:Re: Question about performance
View as plain text  
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 <mdykman@stripped>

> 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 <ravamo@stripped>
> 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
>  - mdykman@stripped
>
>  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/

Thread
Question about performanceRafael Valenzuela17 Feb
  • Re: Question about performanceMichael Dykman17 Feb
    • Re: Question about performanceRafael Valenzuela17 Feb
      • Re: Question about performanceMichael Dykman17 Feb
      • Re: Question about performanceReindl Harald17 Feb
  • Re: Question about performanceAndrás Lukács1 Mar