Question about performance

Question about performance

am 17.02.2011 21:52:22 von Rafael Valenzuela

--001636426d7b2ab4a9049c8094b1
Content-Type: text/plain; charset=ISO-8859-1

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
My Faborite Web
http://www.technologyreview.com/

--001636426d7b2ab4a9049c8094b1--

Re: Question about performance

am 17.02.2011 22:02:01 von Michael Dykman

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

On Thu, Feb 17, 2011 at 3:52 PM, Rafael Valenzuela 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
> My Faborite Web uter-Science/index.htm>
> http://www.technologyreview.com/
>



--=20
=A0- michael dykman
=A0- mdykman@gmail.com

=A0May the Source be with you.

--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe: http://lists.mysql.com/mysql?unsub=3Dgcdmg-mysql-2@m.gmane.o rg

Re: Question about performance

am 17.02.2011 22:16:36 von Rafael Valenzuela

--0016e65dc160db1421049c80ea8d
Content-Type: text/plain; charset=ISO-8859-1

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

> 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
>
> On Thu, Feb 17, 2011 at 3:52 PM, Rafael Valenzuela
> 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
> > My Faborite Web<
> http://ocw.mit.edu/OcwWeb/Electrical-Engineering-and-Compute r-Science/index.htm
> >
> > http://www.technologyreview.com/
> >
>
>
>
> --
> - michael dykman
> - mdykman@gmail.com
>
> May the Source be with you.
>



--
Mit forever
My Blog
My Faborite Web
http://www.technologyreview.com/

--0016e65dc160db1421049c80ea8d--

Re: Question about performance

am 17.02.2011 22:27:23 von Michael Dykman

--0016e6d58a4b31a3ae049c8110f1
Content-Type: text/plain; charset=ISO-8859-1

Rafael,

You realize that script will kill perfectly well-behaved queries in
mid-flight? If you have so many dead connections that it is interfering
with operation, you have another problem elsewhere..

- md

On Thu, Feb 17, 2011 at 4:16 PM, Rafael Valenzuela wrote:

> 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
>
> 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
>>
>> On Thu, Feb 17, 2011 at 3:52 PM, Rafael Valenzuela
>> 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
>> > My Faborite Web<
>> http://ocw.mit.edu/OcwWeb/Electrical-Engineering-and-Compute r-Science/index.htm
>> >
>> > http://www.technologyreview.com/
>> >
>>
>>
>>
>> --
>> - michael dykman
>> - mdykman@gmail.com
>>
>> May the Source be with you.
>>
>
>
>
> --
> Mit forever
> My Blog
> My Faborite Web
> http://www.technologyreview.com/
>
>
>
>


--
- michael dykman
- mdykman@gmail.com

May the Source be with you.

--0016e6d58a4b31a3ae049c8110f1--

Re: Question about performance

am 17.02.2011 22:39:07 von Reindl Harald

--------------enig38E000E3432C8649ADCCC0C0
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable

I am working with mysql since many yaers and i have never
found e reason to kill braindead connections - what
benefit do you think to have from such actions instead
looking why there are hanging ones?

kill a connection of postfix and some user gets
"temorary lookup error", php-scripts are closing
connections after the request

if you have long living connections from php
you have "persistent connections" active - so
why do you not disable the feature if you do
not like it instead writnign dirty scripts?

Am 17.02.2011 22:16, schrieb Rafael Valenzuela:
> Hi Michael:
>=20
> Yeah , i think that i do a shell script.something like that.
>=20
> require 'mysql'
>=20
> mysql =3D Mysql.new(ip, user, pass)
> processlist =3D mysql.query("show full processlist")
> killed =3D 0
> processlist.each { | process |
> mysql.query("KILL #{process[0].to_i}")
> }
> puts "#{Time.new} -- killed: #{killed} connections"


--------------enig38E000E3432C8649ADCCC0C0
Content-Type: application/pgp-signature; name="signature.asc"
Content-Description: OpenPGP digital signature
Content-Disposition: attachment; filename="signature.asc"

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.11 (GNU/Linux)
Comment: Using GnuPG with Fedora - http://enigmail.mozdev.org/

iEYEARECAAYFAk1dlXsACgkQhmBjz394Ann2fQCcCJBb1/gpsm8KyH/pB64L 0DT6
uyQAnR/Z8QETV2XUpMVdpNFdUl7ZKgDC
=Y4XF
-----END PGP SIGNATURE-----

--------------enig38E000E3432C8649ADCCC0C0--

Re: Question about performance

am 01.03.2011 12:06:27 von lukacsandras

Or you can interrupt the query instead, although I've seen it not to
work on occasions: KILL QUERY id;

--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe: http://lists.mysql.com/mysql?unsub=gcdmg-mysql-2@m.gmane.org