Thanks Ravi. That definitely did help. However, the scenario that I wish to monitor is when there are a lot of sleeping threads, it is peak-hour, and the number of threads is dangerously near to the max_connections value. Hence, I would want to log similar information as described in the blog, but on another server. Hence, I would not be using up any up any conenctions on my live server for this.
My issue is that I want to log the MySQL connection id of server1 in server 2. How will I achieve this, as connection_id() will return the current connection id (i.e. for server2)? Regards, Rithish. -----Original Message----- From: Ravi Prasad LR [mailto:[EMAIL PROTECTED] Sent: Friday, July 28, 2006 9:36 AM To: Rithish Saralaya Cc: MySQL general mailing list Subject: Re: identify process that created the connection This blog may help, http://www.xaprb.com/blog/2006/07/23/how-to-track-what-owns-a-mysql-connecti on/ Cheers, Ravi Rithish Saralaya wrote: > Hello people. > > Is it possible to find the process that invoked the mysql thread, > given a mysql thread id? > > We have a web application that runs on Linux-Apache-MySQL-PHP; and I > sometimes see numerous mysql threads in sleeping mode when I run > mytop. I think the sleeping mysql threads could be due to the fact > that some of my > web-page(s) have obtained a mysql connection, executed their queries, > but have not terminated(and have not released the mysql connection > also). If I could know the httpd processes that have created these > connections, I would be able to find out the pages that are the culprit. > > Regards, > Rithish. > > -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe: http://lists.mysql.com/[EMAIL PROTECTED]