List:General Discussion« Previous MessageNext Message »
From:Prabhat Kumar Date:July 12 2010 7:40pm
Subject:Re: finding exact query being run
View as plain text  
 In my.cnf, check wait_timeout value , default is  4800. Make it to
wait_timeout = 60
Thus, the connections will automatically be closed after waiting for 60
seconds.

On Mon, Jul 12, 2010 at 11:51 PM, John Daisley
<daisleyjohn@stripped>wrote:

> If you have lots of sleeping processes the chances are you have a poorly
> written app that is not closing its database connections. Those sleeping
> processes are just connections waiting for another command from the
> application or whatever else initiated them.
>
> The sleeping processes will not show up in the slow query log because they
> are not slow queries and you cannot see the sql they are running because
> they aren't running any.
>
> If you need to prevent these building up (and you do because they will eat
> away at system resources) you can add a wait_timeout option to your my.cnf
> /
> my.ini file but the best way to control these is ensure your app closes its
> connections when it is finished with them and do not use persistent
> connections unless absolutely necessary
>
> Regards
>
> John
>
> --------------------------------
> John Daisley
>
> SQL Server 2005/2008 Database Administrator
> Certified MySQL 5 Database Administrator
> Certified MySQL 5 Developer
> Cognos BI Developer
>
> Telephone: +44 (0)7918 621621
> Email: john.daisley@stripped
>
> ---------------------------------
>
> On 12 July 2010 16:39, Machiel Richards <machielr@stripped> wrote:
>
> >  Hi All
> >
> >
> >
> >                 I am trying to find out how to see the exact query being
> > run.
> >
> >
> >
> >                 When running show processlit, I get a lot of processes
> that
> > have been running for a VERY long time.
> >
> >
> >
> >                 I a trying to find out exactly what query it is that is
> > being run , any ideas?
> >
> >
> >
> >                 I tried the slow query log but it is not showing up in
> > there.
> >
> >
> >
> >                 All the queries are showing “sleep”
> >
> >
> >
> >                 Not sure if this means anything....
> >
> >
> >
> > Machiel Richards
> >
> > MySQL DBA
> >
> > Relational Database Consulting
> >
> >
> >
> > [image: RDC_Logo]
> >
> >
> >
>
>
>
> --
> John Daisley
>
> Certified MySQL 5 Database Administrator
> Certified MySQL 5 Developer
> Cognos BI Developer
>
> Telephone: +44 (0)7918 621621
> Email: john.daisley@stripped
>



-- 
Best Regards,

Prabhat Kumar
MySQL DBA
Datavail-India Mumbai
Mobile     : 91-9987681929
www.datavail.com

My Blog: http://adminlinux.blogspot.com
My LinkedIn: http://www.linkedin.com/in/profileprabhat

Thread
finding exact query being runMachiel Richards12 Jul
  • Re: finding exact query being runMichael Dykman12 Jul
    • RE: finding exact query being runMachiel Richards12 Jul
      • Re: finding exact query being runMichael Dykman12 Jul
        • RE: finding exact query being runmachiel.richards12 Jul
          • Re: finding exact query being runMichael Dykman12 Jul
  • Re: finding exact query being runJohn Daisley12 Jul
    • Re: finding exact query being runPrabhat Kumar12 Jul
  • RE: finding exact query being runDaevid Vincent13 Jul
    • Re: finding exact query being runJohan De Meersman13 Jul
      • RE: finding exact query being runDaevid Vincent13 Jul